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.