• blank pages after deleting range (VBA / Word xp / windows xp)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » blank pages after deleting range (VBA / Word xp / windows xp)

    Author
    Topic
    #381047

    I am using VBA to delete a section of a word document from a starting point to an end point. When I run this code, the delete works, but I’m left with a blank page in my document. How can I get it to work so that the text readjusts itself so that there aren’t any blank pages? ps. could someone please reply to my last post – i would really appreciate getting some insight!

    Taibe

    Viewing 1 reply thread
    Author
    Replies
    • #640454

      Word can’t have a completely blank page, there must be something on it, even if it is only a paragraph mark or a page break.

      Can you enable Tools > Options > View > All and see what is on your “blank” page.
      Is this the first page in the document? Or the last one? Or just in the middle somewhere?
      How are you selecting the text to delete?

      StuartR

      • #640674

        Thanks for the tip, Stuart. I did “view all” and found a lot of things that needed fixing in the template that I’m working with. I received this template from someone else, and did not realize there was so much “gobbledy-gook” in it. doh

    • #640474

      If you are deleting a Section (capital S), perhaps you are leaving an end-of-section marker that is adding a page break? Deleting Section markers can wreak havoc with formatting, so solving one problem could create others…

      • #640673

        Thanks, I’m not deleting Section objects, just my own definition of sections within the document. Actually, I’m marking off the sections with text in brackets eg. [Title Page] (before the title page section) and [end title page] (at the end of it). I was deleting everything from the first [ to the final ]. Now, I got smart and am deleting everything from the ] of the end of the previous section to the [ of the beginning of the next section (providing of course that they’re not the first or last sections of the document. It seems to be working better now.

    Viewing 1 reply thread
    Reply To: Reply #640454 in blank pages after deleting range (VBA / Word xp / windows xp)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel