Closed timohahaa closed 1 year ago
The issue is because that you used the LoadBodyItems
function, which will clear the doc file. Actually I have written a function named func (f *Docx) AppendFile(af *Docx)
for the file-appending. You can refer to the last few lines of the file structdoc.go
.
As for the \n
, it is ignored by Word because it is replaced by just adding a new paragraph.
Thanks for the help!
I try to append new text to an existing docx file like this:
but it just adds new content and erases the old file...
It also seems to ignore '\n' in the text - no new lines are made, how do I insert a new line?