I am not experienced with spire.doc, maybe answer is easy, but I can´t figure it out.
After opening existing main.docx and starting on a new page (append pageBrake)
Firstly I need to Insert a simple text line with the name of the sometext.rtf file
before I insert its content.
So the new clean page at the end of the main.docx
should contain one text line right above the inserted file content.
But the problem is, that the one text line is on the page all alone,
and the sometext.rtf content is placed - jumped on the another page.
I need them to be placed together on one page.
How to insert file content without jumping on the next page?
My code is like this so far:
- Code: Select all
Dim document As New Document
document.LoadFromFile("D:\main.docx", FileFormat.Docx, "password1")
document.LastParagraph.AppendBreak(BreakType.PageBreak)
document.LastParagraph.AppendText("Content of: sometext.rtf")
document.LastParagraph.AppendBreak(BreakType.LineBreak)
document.InsertTextFromFile("D:\sometext.rtf", FileFormat.Rtf)
document.SaveToFile("D:\output.docx", FileFormat.Docx)
Process.Start("D:\output.docx", FileFormat.Docx)