Posted 3 March 2020, 8:56 pm EST
I’m trying to generate a document where part of that document is another document.
The reason for this is we have some static information placed in a common document. This information is used in a number of different documents that I’m generating.
I want to insert this static document content (it contains among other things a table) into a specific location in the document I’m generating.
I’ve managed to get some information in but not at the location I want and also I don’t get all the information for some reason.
This is what I do now:
//Find range where I want the static document inserted PersistenRange pr; //This points to the text (“<Attacment”>) in the document I’m generated.
//load the static document GcWordDocument doc = new GcWordDocument(); doc.Load();
//Select all of my static document content. var range = doc.Body.GetPersistentRange(doc.bBody.Start, doc.Body.End);
//Insert static document content into the document I’m generating range.CopyTo(rr.ParentSection.GetRange(), InsertLocation.End);
This gives me about 25% of the static document inserted into the document I’m generating. It also placed in the wrong location.
So obviously I’m doing somthing worng here.
Can you help me?