Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    UK
    Posts
    239
    Thanks
    4
    Thanked 1 Time in 1 Post

    Select all text on page

    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?

  2. #2
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Oklahoma, Oklahoma, USA
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select all text on page

    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.

  3. #3
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    Willow Grove, Pennsylvania, USA
    Posts
    205
    Thanks
    4
    Thanked 49 Times in 40 Posts

    Re: Select all text on page

    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

  4. #4
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    UK
    Posts
    239
    Thanks
    4
    Thanked 1 Time in 1 Post

    Re: Select all text on page

    It worked well enough for my purposes. Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •