Selecting all text on page

I

incjourn

Hi,

I am trying to write a routine that selects all the text on the curren
page and the copies it to the clip board. At the moment I am using th
Range and Extend method. This requires you to know how many lines ar
in the current page, is there a way of getting this info, or us there
better way to do what I'm trying to do?

Phi
 
G

Guest

Hi Phil,

I recorded the following code:

Selection.Extend
Application.Browser.Next
Selection.Copy

I placed the cursor at the top of the page, then pressed
F8 to start extend mode, then pressed Ctrl+Pg Down to
select to the end of the page, then copied to the
clipboard.

I hope this helps.

Regards
J Pettigrew
(e-mail address removed)
 
J

Jean-Guy Marcil

Hi,
I am trying to write a routine that selects all the text on the current
page and the copies it to the clip board. At the moment I am using the
Range and Extend method. This requires you to know how many lines are
in the current page, is there a way of getting this info, or us there a
better way to do what I'm trying to do?

'_______________________________________
Dim PageRange As Range

Set PageRange = ActiveDocument.Bookmarks("\Page").Range

PageRange.Copy
'_______________________________________

Note that this will also include any Section/Page break (at the bottom of
the page) and will never include the last paragraph mark in the document.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top