GoTo End of text

T

Tom

Using Word 2003, is it possible, using vba, that when an existing document
is opened the cursor is placed at the end of the text in that document.

If possible, an example of code would be appreciated

Tom
 
G

Greg Maxey

Tom

Something like:

Sub GoToEnd()
With ActiveDocument
.Range(Start:=.Range.End - 1, End:=.Range.End - 1).Select
End With
End Sub

Change the name to Sub AutoOpen()
 
H

Helmut Weber

Hi everybody,
in autoopen
ActiveDocument.Bookmarks("\endofdoc").Select

Greetings from Bavaria, Germany

Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 
T

Tom

Thanks Helmet and Greg

The code was put in autoopen. What is being noticed is that if we open Doc1
from word the code works OK, however if we are using Doc1 as the document &
with Access use OLE automation for a mail merge the cursor goes to the
begining of the document..

Is there a way of incorporation the required code into the OLE automation
code

Tom
 
T

Tom

Don't worry about this - got it working

Tom said:
Thanks Helmet and Greg

The code was put in autoopen. What is being noticed is that if we open
Doc1 from word the code works OK, however if we are using Doc1 as the
document & with Access use OLE automation for a mail merge the cursor goes
to the begining of the document..

Is there a way of incorporation the required code into the OLE automation
code

Tom
 

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