Setting cursor at start of Doc?

J

JB

Hi Folks,

i want to set the cursor at the beggining of my document which is opened
programatically then start my code from the very start of the document.

Any Ideas?

Cheers
 
D

Doug Robbins - Word MVP

Hi JB,

Use Selection.HomeKey wdStory

Or using a range, use

Dim myrange As Range
Set myrange = ActiveDocument.Range
myrange.Collapse wdCollapseStart
' or myrange.End = myrange.Start

and then operate with myrange.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
W

Word Heretic

G'day "JB" <[email protected]>,

use the range of the document.content

eg

Dim Distance as Range
Set Distance = ActiveDocument.Content

Now you can go the distance...


JB said:
Hi Folks,

i want to set the cursor at the beggining of my document which is opened
programatically then start my code from the very start of the document.

Any Ideas?

Cheers

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email (e-mail address removed)
Products http://www.geocities.com/word_heretic/products.html

Replies offlist may require payment.
 

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