Example:
var aspose = aspose || {}; aspose.diagram = require("aspose.diagram"); diagram = new aspose.diagram.Diagram("Macro.vsdm"); // extract VBA project v = diagram.getVbaProject(); // Iterate through the modules and modify VBA macro code for (i = 0; i < diagram.getVbaProject().getModules().getCount(); i++) { module = diagram.getVbaProject().getModules().get(i); code = module.getCodes(); if (code.indexOf("This is test message.") != -1) { code = code.replace("This is test message.", "This is Aspose.Diagram message."); } module.setCodes(code); } // save the Visio diagram diagram.save("out-ModifyVBAModule.vssm", aspose.diagram.SaveFileFormat.VSSM);
Property Getters/Setters Summary | ||
---|---|---|
method | isSigned() | |
Indicates whether VBAcode is signed or not.
|
||
method | getModules() | |
Gets all |
||
method | getName() | |
method | setName(value) | |
Gets and sets the name of the VBA project. | ||
method | getReferences() | |
Gets all references of VBA project.
|
String getName() / setName(value)
boolean isSigned()
VbaModuleCollection getModules()
VbaProjectReferenceCollection getReferences()