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 sample 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)

1using System;
2using GemBox.Document;
3
4class Sample
5{
6    [STAThread]
7    static void Main(string[] args)
8    {
9        // If using Professional version, put your serial key below.
10        ComponentInfo.SetLicense("FREE-LIMITED-KEY");
11
12        DocumentModel document = DocumentModel.Load("Macros.docm");
13
14        document.Save("Macros.docm");
15    }
16}
1Imports System
2Imports GemBox.Document
3
4Module Samples
5
6    Sub Main()
7
8        ' If using Professional version, put your serial key below.
9        ComponentInfo.SetLicense("FREE-LIMITED-KEY")
10
11        Dim document As DocumentModel = DocumentModel.Load("Macros.docm")
12
13        document.Save("Macros.docm")
14
15    End Sub
16
17End Module

Check next sample or find out more about GemBox.Document and GemBox Software.