Microsoft supports adding VBA macros in MS Word documents to automate or trigger various operations. While working with Word documents programmatically, you may have to manipulate VBA macros. For such cases, this article demonstrates how to add or modify VBA macro in a Word document in C#.

Aspose.Words for .NET logo

Create and Modify VBA Macros in Word Documents using C#

A new property VbaModule.SourceCode has been added in this release to get or set VBA project module source code. The following code example demonstrates how to modify VBA Macros using the VbaModule.SourceCode property.

C# Word Library - Features You May Like

Create Repeating Section Content Control in Word Document

MS Word allows you to insert the repeating content control with XML mapping in Word document. You can insert repeating content control around entire paragraphs or table rows. We have added this feature in the latest release of Aspose.Words. A new enumeration type RepeatingSectionItem has been added in this release.

Please read the following article for more detail.

LINQ Reporting with XML, JSON, and CSV Data Sources

As you know, LINQ Reporting Engine enables you to build reports using an extended set of reporting features. The engine enables you to reference business objects of your application in report templates. We have added XmlDataSource, JsonDataSource, and CsvDataSource classes in this release to use XML, JSON, and CSV as data sources to generate reports using LINQ Reporting. Please read the following articles for complete detail of this feature.

MS Word allows you to link custom document property to a bookmark. In MS Word, you can check this option under document properties dialog. In this release, we have added LinkSource and IsLinkToContent properties in DocumentProperty class and a method AddLinkToContent in CustomDocumentProperties class. The following code example shows how to link custom document property to a bookmark.

We recommend you please check the release notes of Aspose.Words for .NET 19.9 for complete detail of API changes.

When time allows you can check Aspose.Words’ API reference guide, examples at Github, talk about this release and other API related issues in our forum.

Tip: You may want to check out Aspose FREE macro removal web app.