• Select all text on page

    Author
    Topic
    #353266

    Is it possible in VBA to select all text between hard page breaks from where the cursor is OR all text on the page?
    All the options I can see relate to paragraphs (number of), sentences, cells, styles etc. I need to select whatever is on the page and the numbers (sentences, paragraphs etc) and styles will vary.
    If this is not possible, then I have in mind to replace all page breaks (9,000 plus) with section breaks and then select all in the section. Or does anyone have a better idea?

    Viewing 1 reply thread
    Author
    Replies
    • #516239

      Hmmmm, have never tried this but I do know there are keystrokes that will take you to the top of the current page and to take you to the top of the next page. Could you maybe combine these with extended select and get the job done? I’m sure that’s a clumsy way to do it but I wonder if it would work.

      • #516254

        It worked well enough for my purposes. Thanks

    • #516246

      The trick here is to use a pre-defined bookmark named “Page” (there’s a list of these things in the VBA help under “Predefined Bookmarks”). Try this line of code:

      Selection.Bookmarks(“page”).Select

    Viewing 1 reply thread
    Reply To: Select all text on page

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

    Your information: