com.aspose.words
Class VbaProject

java.lang.Object
    extended by com.aspose.words.VbaProject

public class VbaProject 
extends java.lang.Object

Provides access to VBA project information. A VBA project inside the document is defined as a collection of VBA modules.

Example:

Shows how to get access to VBA project information in the document.
Document doc = new Document(getMyDir() + "Document.TestButton.docm");

// A VBA project inside the document is defined as a collection of VBA modules
VbaProject vbaProject = doc.getVbaProject();

VbaModuleCollection vbaModules = doc.getVbaProject().getModules();
for (VbaModule module : vbaModules) {
    System.out.println(MessageFormat.format("Module name: {0};\nModule code:\n{1}\n", module.getName(), module.getSourceCode()));
}

Property Getters/Setters Summary
VbaModuleCollectiongetModules()
           Returns collection of VBA project modules.
java.lang.StringgetName()
           Returns VBA project name.
 

Property Getters/Setters Detail

getModules

public VbaModuleCollection getModules()
Returns collection of VBA project modules.

Example:

Shows how to get access to VBA project information in the document.
Document doc = new Document(getMyDir() + "Document.TestButton.docm");

// A VBA project inside the document is defined as a collection of VBA modules
VbaProject vbaProject = doc.getVbaProject();

VbaModuleCollection vbaModules = doc.getVbaProject().getModules();
for (VbaModule module : vbaModules) {
    System.out.println(MessageFormat.format("Module name: {0};\nModule code:\n{1}\n", module.getName(), module.getSourceCode()));
}

getName

public java.lang.String getName()
Returns VBA project name.

Example:

Shows how to get access to VBA project information in the document.
Document doc = new Document(getMyDir() + "Document.TestButton.docm");

// A VBA project inside the document is defined as a collection of VBA modules
VbaProject vbaProject = doc.getVbaProject();

VbaModuleCollection vbaModules = doc.getVbaProject().getModules();
for (VbaModule module : vbaModules) {
    System.out.println(MessageFormat.format("Module name: {0};\nModule code:\n{1}\n", module.getName(), module.getSourceCode()));
}

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.