Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

Setting the cursor for a new document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lüko Willms - 06 Oct 2006 10:42 GMT
Using MS-Word, I want to put the cursor at a specific place in
a new document which is being created on the basis of a template
which contains some VBA programming with a "Document_New" procedure.

 The cursor should not be at the very top of the first page,
but at a specific, still empty, paragraph. The text before is part of
the template resp. generated via Fields.

 I tried a

   ActiveDocument.Goto What:=wdGoToBookmark, Name:="myBookmark"

and alternatively

   ActiveDocument.ActiveWindow.Goto What:=wdGoToBookmark,
Name:="myBookmark"

but it did not help.

  What is the correct way to do this? What am I missing?

Yours,
L.W.
Germany
Shauna Kelly - 06 Oct 2006 13:29 GMT
Hi Lüko

Here is one way:
   ActiveDocument.Bookmarks("MyBookmark").Select

If the bookmark covers several characters or words, you might then do:
   Selection.Collapse wdCollapseStart 'or wdCollapseEnd

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

>  Using MS-Word, I want to put the cursor at a specific place in
> a new document which is being created on the basis of a template
[quoted text clipped - 20 lines]
> L.W.
> Germany
Lüko Willms - 06 Oct 2006 18:43 GMT
Am Fri, 6 Oct 2006 12:29:39 UTC,  schrieb "Shauna Kelly"
<ShaunaKelly@SendNoSpamToShaunaKelly.com>  auf
microsoft.public.word.vba.beginners :

> Here is one way:
>     ActiveDocument.Bookmarks("MyBookmark").Select

 Thank you, that did the trick. The cursor is where I wanted it.

Yours,
L.W.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.