C# Remove a Page Break in MS Word

Posted on 2014-08-15
Last Modified: 2014-08-26
I am working with MS Word Interop.  I converted a document from Crystal to MS Word in RTF Format and a page break is in the document.  I need to delete the page break.

Any ideas?
Question by:CipherIS
    LVL 100

    Expert Comment

    I can think of 3 ways to maybe do that.

    1.  Set the paper size so it is tall enough to handle the report on a single page.  Try legal and ledger.  You may have to create a custom paper size.

    2. Install a new printer driver that handles larger pages.  You can even use a plotter which can handle some very large pages.  May have to set width margin (right and left) in the report to limit the width.

    3.  Set the No Printer option in the page setup.  Also set the option to DISSOCIATE PAGE SIZE FROM PRINTER

    LVL 1

    Author Comment

    I need to delete programmatically unfortunately.
    LVL 1

    Accepted Solution

    I wrote code in C# to look for "^m" to delete the page break.
    LVL 1

    Author Closing Comment

    Wrote the code and posted the solution.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
    Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now