0
votes

i have a big docx file and i want to split it to a new docx containing only pages with the footer which contains "Appendix B" word in it, can i have some code example or any help.

1
Before post question you should try at-least your side. stackoverflow.com/help/how-to-askuser4856296

1 Answers

1
votes

You can have an algorithm:

  1. inspect the footers to find which ones contain the words of interest. Note the relId in the rels part pointing to such footer.
  2. now go through the main document part, looking at the sectPr elements. Find sectPr elements containing the relId(s). Note that it might be implicit (same as previous).

Provided your footer applies to every page in the relevant section(s), then you can just delete the content before and after, then save the resulting docx.