Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Visual Basic for Applications (VBA) for Microsoft Word 是一种简单但功能强大的编程语言,可用于扩展功能。 Aspose.Words API 提供了三个类来访问 VBA 项目源代码:
Aspose.Words API 提供 VbaProject 属性来获取或设置文档中的 VbaProject。
以下代码示例演示如何创建 VBA 项目和 VBA 模块以及基本属性(例如名称和类型):
Aspose.Words 还为用户提供了读取 VBA 宏的能力。
以下代码示例显示如何从文档中读取 VBA 宏:
使用 Aspose.Words,用户可以修改 VBA 宏。
以下代码示例显示如何使用 SourceCode 属性修改 VBA 宏:
使用 Aspose.Words 还可以克隆 VBA 项目。
以下代码示例演示如何使用 Clone 属性克隆 VBA 项目,该属性创建现有项目的副本:
如果需要,您还可以克隆 VBA 模块。
以下代码示例演示如何使用 Clone 属性克隆 VBA 模块,该属性创建现有项目的副本:
Aspose.Words API 提供 VbaReferenceCollection 类来与表示 VBA 项目引用集合的 VBA 项目引用一起使用。
以下代码示例演示如何从 VBA 项目的引用集合中删除一些引用:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.