LoadDocx.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. '' This sample shows how to load an existing DOCX file into DsWord.
  10. '' It also appends a short note to the end of the loaded document.
  11. public class LoadDocx
  12. Public Function CreateDocx() As GcWordDocument
  13. Dim doc = New GcWordDocument()
  14.  
  15. '' Load an existing DOCX file:
  16. Dim path = System.IO.Path.Combine("Resources", "WordDocs", "JsFrameworkExcerpt.docx")
  17. doc.Load(path)
  18.  
  19. '' Add a note at the end of the document:
  20. doc.Body.Paragraphs.Add($"Loaded into DsWord on {Util.TimeNow():R}.")
  21.  
  22. '' Done:
  23. Return doc
  24. End Function
  25. End Class
  26.