tags:

views:

32

answers:

1

Hi,

I need to extract all VBA code from a Word 2007 document in c# without using office automation.

What I have done so far is to open the Word document as a structured storage file in c#, and I receive a list of the following streams:

Macros
 VBA
   dir ( stream ) 
   Module1 ( stream )  
   ThisDocument ( stream )   
  _VBA_PROJECT_ ( stream )
  ....

I gather that the source is stored in one of those streams, but I have no idea how to parse them.

Can anyone help?

+1  A: 

Probably the documentation of the VBA file format will help you. You can download it for free from Microsoft:

[MS-OVBA]: Office VBA File Format Structure Specification

0xA3