API Reference
Class
WordMacro
Represents a single macro module within a document.
Inheritance
- Object
- WordMacro
Remarks
Instances are returned by Macros and can be removed individually using Remove.
Methods
AddMacro 2 overloads
AddMacro(OfficeIMO.Word.WordDocument document, System.String filePath) #Adds a VBA project from a file to the specified document.
Parameters
- document OfficeIMO.Word.WordDocument
- Target document.
- filePath System.String
- Path to a vbaProject.bin file.
AddMacro(OfficeIMO.Word.WordDocument document, System.Byte[] data) #Adds a VBA project from a byte array to the specified document.
Parameters
- document OfficeIMO.Word.WordDocument
- Target document.
- data System.Byte[]
- VBA project data.
ExtractMacros(OfficeIMO.Word.WordDocument document) #Returns the raw VBA project from the given document.
Parameters
- document OfficeIMO.Word.WordDocument
- Document containing macros.
Returns
Byte array with the macros or null when absent.
GetMacros(OfficeIMO.Word.WordDocument document) #Enumerates all macro modules in the specified document.
Parameters
- document OfficeIMO.Word.WordDocument
- Document to inspect.
Returns
List of WordMacro instances.
RemoveMacro(OfficeIMO.Word.WordDocument document, System.String name) #Removes a single macro module from a document.
Parameters
- document OfficeIMO.Word.WordDocument
- Document to modify.
- name System.String
- Module name to remove.
RemoveMacros(OfficeIMO.Word.WordDocument document) #Removes the entire VBA project from the document.
Parameters
- document OfficeIMO.Word.WordDocument
- Document to modify.
SaveMacros(OfficeIMO.Word.WordDocument document, System.String filePath) #Saves the VBA project from a document to the specified file.
Parameters
- document OfficeIMO.Word.WordDocument
- Source document.
- filePath System.String
- Destination path.
Inherited Methods
public override Boolean Equals(Object obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object