Footnotes.vb
''
'' This code is part of GrapeCity Documents for Word samples.
'' Copyright (c) GrapeCity, Inc. All rights reserved.
''
Imports System.IO
Imports System.Drawing
Imports GrapeCity.Documents.Word

'' Shows how to add and format footnotes.
Public Class Footnotes
    Public Function CreateDocx() As GcWordDocument
        Dim doc = New GcWordDocument()

        Dim sec1 = doc.Body.Sections.First

        Dim pars1 = sec1.GetRange().Paragraphs

        Dim p1 = pars1.Add("Section 1, Paragraph 1. " + LoremIpsumPar())
        p1.GetRange().Footnotes.Add("This is footnote 1 for Section 1, Paragraph 1.")
        p1.GetRange().Footnotes.Add("This is footnote 2 for Section 1, Paragraph 1.")

        Dim p2 = pars1.Add("Section 1, Paragraph 2. ")
        p2.GetRange().Runs.Add(LoremIpsumPar()).GetRange().Footnotes.Add(
            "This is a footnote for the last run in Section 1, Paragraph 2.")

        pars1.Add("Section 1, Paragraph 3. " + LoremIpsumPar())

        '' Done
        Return doc
    End Function
End Class