Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Purpose Summary. What is this page about?
This page demonstrates how to use Aspose.Words for Python via .NET to create, read, modify, clone, and manage VBA macro projects and modules within Word documents, including handling project references.
Visual Basic for Applications (VBA) for Microsoft Word is a simple but powerful programming language that can be used to extend the functionality. Aspose.Words API provides three classes to get access to the VBA project source code:
Aspose.Words API provides the vba_project property to get or set VbaProject in the document.
The following code example demonstrates how to create a VBA project and VBA Module along with basic properties e.g. name and type:
Aspose.Words also provides users with the ability to read VBA macros.
The following code example shows how to read VBA Macros from the document:
Using Aspose.Words, users can modify VBA macros.
The following code example shows how to modify VBA Macros using the source_code property:
With Aspose.Words it is also possible to clone VBA projects.
The following code example shows how to clone the VBA Project using the clone property which creates a copy of the existing project:
You can also clone VBA modules if needed.
The following code example shows how to clone the VBA Module using the clone property which creates a copy of the existing project:
Aspose.Words API provides VbaReferenceCollection class to work with VBA Project References representing a collection of VBA project references.
The following code example shows how to remove some references from the collection of references from a VBA project:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.