Footnotes.vb
  1. ''
  2. '' This code is part of Document Solutions for Word demos.
  3. '' Copyright (c) MESCIUS inc. All rights reserved.
  4. ''
  5. Imports System.IO
  6. Imports System.Drawing
  7. Imports GrapeCity.Documents.Word
  8.  
  9. '' Shows how to add and format footnotes.
  10. Public Class Footnotes
  11. Public Function CreateDocx() As GcWordDocument
  12. Dim doc = New GcWordDocument()
  13.  
  14. Dim pars1 = doc.Body.Paragraphs
  15.  
  16. Dim p1 = pars1.Add("Section 1, Paragraph 1. " + LoremIpsumPar())
  17. p1.GetRange().Footnotes.Add("This is footnote 1 for Section 1, Paragraph 1.")
  18. p1.GetRange().Footnotes.Add("This is footnote 2 for Section 1, Paragraph 1.")
  19.  
  20. Dim p2 = pars1.Add("Section 1, Paragraph 2. ")
  21. p2.GetRange().Runs.Add(LoremIpsumPar()).GetRange().Footnotes.Add(
  22. "This is a footnote for the last run in Section 1, Paragraph 2.")
  23.  
  24. pars1.Add("Section 1, Paragraph 3. " + LoremIpsumPar())
  25.  
  26. '' Done
  27. Return doc
  28. End Function
  29. End Class
  30.