I am attempting to merge multiple docx files. The issue I am having is that each file goes on a new page.
I am using the code below to merge the attached docx 3 times. The file contains 1 line. I expect to get a result file with 1 page with 3 lines. Instead, I get a result file with 3 pages with 1 line each.
How can I merge files to the same page?
Thanks
- Code: Select all
Private Shared Sub testMerge1(file1 As String, merge1 As String)
Dim wordDocument As New Spire.Doc.Document()
For i = 1 To 3
wordDocument.InsertTextFromFile(file1, FileFormat.Docx)
Next
wordDocument.SaveToFile(merge1)
wordDocument.Close()
End Sub