1

I would like to delete/remove specific pages in a word docx with Open XML SDK 2.0.

I have tried using the code from here: blogs.msdn.com/b/brian_jones/archive/2009/06/15/removing-page-and-section-breaks-from-a-word-document.aspx

It only deletes all the section breaks. The pages are still not deleted.

I want to delete a set of pages which has specific set of words or titles.

Please let me know how can I achieve this?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Qwerty
  • 323
  • 1
  • 6
  • 33
  • 1
    I don't think you can delete a page. Because pages determined by text size and images in it, etc. You can delete certain text. – T.S. Feb 14 '14 at 03:53
  • Could the OP delete the text defined by a bookmark or something? That might be useful in the case where it's a special-purpose page, which does not flow. – John Saunders Feb 14 '14 at 03:57
  • I see. Ok, another alternative I thought is: merging the required set of single page docx files into one? How well would that work? Will it will merge accurately as though you insert separate pages in a doc? – Qwerty Feb 14 '14 at 04:08
  • yes, merging single files should work well. instead of removing a page from the word document – Varun Rathore Feb 18 '14 at 08:47
  • Is the open xml sdk a necessary requirement ? – edi9999 Feb 18 '14 at 20:03
  • I couldn't find any other open source free sdk to fill data into word doc from asp.net. Open XML seems like the only option with free and unlimited access. I have several word doc files (docx) each with content control fields now. I use open xml to insert data into each docx file. I then tried to merge with required docx file using http://powertools.codeplex.com/ but it didn't work. It came with error: "Sequence contains no elements" in the DocumentBuilder. It seems that DocumentBuilder does not support content control and custom xml binding for merging docx files...How to solve this? – Qwerty Feb 19 '14 at 04:25

0 Answers0