I need help in splitting the word document using OpenXML. I am trying to split the large word document into multiple word documents with single page in each document. I have to split the word document using OpenXML SDK 2.5 (no third party dlls are allowed). Documents after splitting should contains all the styling and formatting present in original document.
1
votes
Welcome to StackOverflow. Please note, that this is not a free code-writing service. Yet we are eager to help fellow programmers (and aspirants) writing their own code. Please read the help topics on How do I Ask a Good Question. You might also want to take the tour and earn a badge while doing so. Afterwards, please update your question with the VBA code you have written thus far in order to complete the task(s) you wish to achieve. We will be here waiting for you. Ready to assist and help you finalize your code.
– YowE3K
1 Answers
0
votes
Pages do not exist in the OpenXML format until they are rendered by a word processor.
The document may contain <w:lastRenderedPageBreak/>
nodes, which hint at where page breaks occurred the last time the document was rendered though not necessarily where the page break will always occur.
If you have control over the construction of the documents, you can use inline notations to mark where you want to split. For instance, its a straightforward operation to locate and segment on heading levels to split a document of chapters into chapter documents.