开发者

Extracting Macros in a Word Document to a text file from c#

开发者 https://www.devze.com 2023-01-08 14:14 出处:网络
I need to extract all VBA code from a Word 2007 document in c# without using office automation. What I have done so 开发者_StackOverflow中文版far is to open the Word document as a structured storage

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

What I have done so 开发者_StackOverflow中文版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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号