How to remove a page from Word Doc?

How do I remove a page (a blank page in this case) from a Word document?
VB or C#.

Thank You
AB


5 Replies

SY Sethumanikkam Yogendran Syncfusion Team November 6, 2017 06:59 AM UTC

Hi Alan,

Thank you for contacting Syncfusion support.

The Word document is a flow document in which contents will not be preserved page by page; instead the contents will be preserved sequentially section by section. Each section may extend to various pages based on its contents like table, text, images etc.

Word viewer/editor renders the contents of the Word document page by page dynamically when opened for viewing or editing and this page wise rendered information will not be preserved in the document level as per the Microsoft Word file format specification. Whereas Essential DocIO is a non-UI component that provides a full-fledged document object model to manipulate the Word document contents.

Hence it is not directly possible to access the Word document contents page by page, the same holds in Essential DocIO. As a workaround, you can split the contents of each page as separate section in the Word document and access the contents by sections instead of pages.

Kindly refer the below link to know more about working with sections using DocIO.
https://help.syncfusion.com/file-formats/docio/working-with-sections

How do I remove a page (a blank page in this case) from a Word document?
On further analyzing with the given details, we have prepared a sample to remove blank pages (i.e. remove empty sections) from end of the document. Kindly refer the sample from below link, and let us know if this helps you.

Sample link:
http://www.syncfusion.com/downloads/support/forum/133565/ze/Sample_F133565_-974574440.zip
Note: Please find the input and output from respective folders inside the sample.

If we misunderstood any of your requirement, then kindly elaborate the actual requirement with detailed description along with the sample or modified sample of above from your end and screenshot/output Word document of the expected result which will be helpful to provide you the appropriate solution at the earliest.


Please let us know if you have any other questions.

Regards,
Sethumanikkam.Y



AB Alan Burkhart November 9, 2017 05:14 PM UTC

Thank you! This looks like something I can work with. I will convert it to VB and add it to my project.

Thanks Again

AB



SY Sethumanikkam Yogendran Syncfusion Team November 10, 2017 09:01 AM UTC

Hi Alan,

Thank you for your update.

Please try the solution and let us know if you need any further assistance on this. We will be happy to assist you as always.

Regards,
Sethumanikkam.Y



AB Alan Burkhart November 10, 2017 04:41 PM UTC

Incorporated your sample code into my project with only a few changes. Strips out empty pages very quickly. Thanks again for a quick and helpful response.



SY Sethumanikkam Yogendran Syncfusion Team November 13, 2017 09:03 AM UTC

Hi Alan,

Thank you for your update.

We are happy to hear that the provided sample resolved your requirement. Please let us know if you need any further assistance on this. We will be happy to assist you as always.

Please let us know if you have any other questions.

Regards,
Sethumanikkam.Y


Loader.
Up arrow icon