GemBox.Document is a .NET component that enables you to read, write, edit, convert, and print document files from your .NET applications using one simple API.

Macros

GemBox.Document supports most of the Microsoft Word document features, but not all.

Nevertheless, unsupported features can be preserved when reading a document so that they are not lost when writing a document to the same format.

Following example demonstrates how GemBox.Document preserves macros.

Screenshot
Macros Screenshot

See the full code below, use Run Example to execute.

Upload your file(Drag files here)

Download a sample file

using System;
using GemBox.Document;

class Sample
{
    [STAThread]
    static void Main(string[] args)
    {
        // If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY");

        DocumentModel document = DocumentModel.Load("Macros.docm");

        document.Save("Macros.docm");
    }
}
Imports System
Imports GemBox.Document

Module Samples

    Sub Main()

        ' If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY")

        Dim document As DocumentModel = DocumentModel.Load("Macros.docm")

        document.Save("Macros.docm")

    End Sub

End Module

Check next sample.