I am merging multiple documents together and my final output seems to have a blank page always at the top and I cant seem to get rid of it.
Maybe the way I am going about merging the documents have something to do with it.
This is how I start off in the code:
I create my 'doc' document using a Template from the example (after setting it up per my project):
Document doc = new Document(System.IO.Path.Combine(DocPath, "MergeTemplate.doc"));
Then it goes into a loop, and if its the first loop I need to setup the Table of contents, so I have to generate it from code
before I generate it I create another 'doc' document like so:
//Open the template document
Document doc3 = new Document(System.IO.Path.Combine(DocPath, "WWHTemplate.doc"));
//Once the builder is created, its cursor is positioned at the beginning of the document.
DocumentBuilder builder = new DocumentBuilder(doc3);
//generate the TOC
bool toc = BuildTOC(builder);
Could this be way the leading page is blank and the TOC is actually the second page?
I tried using the main 'DOC' that I declared at first instead of createing doc3, but the blank page was the second page now instead of the first.
Any clue why it does this? Im not adding any pagebreaks before this code, but the blank page does seem to move when I use 'doc' instead of 'doc3'.
sorry if this is vague, cant think of a better way to explain it.
EDIT: Also note that the way I am saving this is doc3.save(), not doc.save()
I then add the saved filename to an Arraylist, because in the end of the loop I take that arraylist and loop through it, and call AppendDoc() with that filename.