include the text of a docx file into another docx file

May 10, 2016 at 12:13 PM
Hello,
I'm search a solution for include the text of a docx file into another docx file, but in a specific position, not append to the end of the file.
I have not understand if it was possible with docx dll or not.
Thanks,
Pam
Developer
May 10, 2016 at 8:45 PM
You would need to put a place holder to know what to search for and then use "replace". If it's more advanced doc then you would need to write some custom code.
May 11, 2016 at 7:37 AM
It's more advanced... i'm verify that the docx was included perfectly to the end or init of the file with the includedocument, but i don't find a way for include in the midle... now i'm looking for copy one paragraph at a time, but i lost a lot of property...
any idea?
:)
Developer
May 11, 2016 at 7:45 AM
Well you can try and dive into the source code. I guess you're using the merge method or similar. Find it in the source code, see what it does and and create new method based on it but "connect" it with some PlaceHolder search from Replace method.
May 11, 2016 at 10:44 AM
working with paragraph i've find a way to include the text with format...

Dim parBok As Novacode.Paragraph = doc.Bookmarks("FileProgetto").Paragraph
    For i As Integer = doc1.Paragraphs.Count - 1 To 0 Step -1
        Dim parOrig As Novacode.Paragraph = doc1.Paragraphs(i)
        Dim par As Novacode.Paragraph = parBok.InsertParagraphAfterSelf(parOrig)
    Next
the problem now is that i've lost the image...