public class VbaModuleType
extends java.lang.Object
Examples:
Shows how to create a VBA project using macros.
Document doc = new Document();
// Create a new VBA project.
VbaProject project = new VbaProject();
project.setName("Aspose.Project");
doc.setVbaProject(project);
// Create a new module and specify a macro source code.
VbaModule module = new VbaModule();
module.setName("Aspose.Module");
module.setType(VbaModuleType.PROCEDURAL_MODULE);
module.setSourceCode("New source code");
// Add the module to the VBA project.
doc.getVbaProject().getModules().add(module);
doc.save(getArtifactsDir() + "VbaProject.CreateVBAMacros.docm");
| Modifier and Type | Field and Description |
|---|---|
static int |
CLASS_MODULE
A module that contains the definition for a new object.
|
static int |
DESIGNER_MODULE
A VBA module that extends the methods and properties of an ActiveX control that has been registered with the project.
|
static int |
DOCUMENT_MODULE
A type of VBA project item that specifies a module for embedded macros and programmatic access operations that are associated with a document.
|
static int |
length |
static int |
PROCEDURAL_MODULE
A collection of subroutines and functions.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String vbaModuleTypeName) |
static java.lang.String |
getName(int vbaModuleType) |
static int[] |
getValues() |
static java.lang.String |
toString(int vbaModuleType) |
public static int DOCUMENT_MODULE
public static int PROCEDURAL_MODULE
public static int CLASS_MODULE
public static int DESIGNER_MODULE
public static int length