Merging two documents and setting a sectionbreak odd page between them

Home Forums WordprocessingML Merging two documents and setting a sectionbreak odd page between them

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3267
    Eric White
    Keymaster

    Yes, keeping the sections in the other sources will definitely put those sections in the generated document, and a section is defined as the content between it and the previous section, per the spec.

    If you really need to control the very specific properties of each section, then run DocumentBuilder in a loop – add a document – and then tweak the last section in the document, add the next document, and then tweak the last section, and repeat until you have added all of your documents. By tweaking the last w:sectPr in the document, you write a bit of code to go in and make the necessary changes to the property, and save the document.

    It is still going to be very fast – what kind of volumes do you anticipate? It runs in the hundreds of documents per second, if I recall correctly.

    If you review the screen-cast on sections, headers, and footers, you will recall that the last section props is the last child element of the w:body element, so it is easy to get to the last section.

    #3269
    Samo
    Participant

    Hello,

    thanks for the suggestion. The number of documents to append will be low, usually 2 to 5 with a couple of pages in each document. So i do not think that speed will be an issue.

    So do i understand the workflow right?
    I should grab the first document, then manipulate the last section prop and append the next document via the documentbuilder.
    Then build the document and repeat the procedure for the remaining documents to append.

    I will give this a try and report back, thanks so far 🙂

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.