Word and PDF Library for C# and VB.NET applications

The fastest way how you can get started with GemBox.Document library is by exploring our collection of C# and VB.NET examples. These are live examples that demonstrate various supported Word features in GemBox.Document.

System Requirements

GemBox.Document requires only the .NET Framework version 3.0 or above.

Hello World

The following example creates a simple Word file, with 'Hello World!' text, using C# and VB.NET code. It shows how to initialize the GemBox.Document content model, populate common document elements (Section, Paragraph, and Run), and then save a DocumentModel instance to a Word or PDF file.

Word and PDF Library for C# / VB.NET Screenshot

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

using System;
using GemBox.Document;

class Sample
    static void Main(string[] args)
        // If using Professional version, put your serial key below.

        DocumentModel document = new DocumentModel();

        Section section = new Section(document);

        Paragraph paragraph = new Paragraph(document);

        Run run = new Run(document, "Hello World!");

        document.Save("Hello World.docx");
Imports System
Imports GemBox.Document

Module Samples

    Sub Main()

        ' If using Professional version, put your serial key below.

        Dim document As DocumentModel = New DocumentModel

        Dim section As New Section(document)

        Dim paragraph As New Paragraph(document)

        Dim run As New Run(document, "Hello World!")

        document.Save("Hello World.docx")

    End Sub

End Module

Check next sample.