Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Having trouble with Automating Goto in MS Word
Message
From
30/03/2001 07:36:16
 
 
To
29/03/2001 16:11:29
Bill Drew
Independent Consultant
Chicago, Illinois, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00490068
Message ID:
00490262
Views:
12
>I recorded a macro of the operation. The VBA code is Selection.GoTo What:=wdGoToBookMark, Name:="RegisName". I include a type library so that the constant wdGoToBookMark gets tranlated to the value -1.
>
>I Translate the named parameters to ordered parameters in the Fox code: oWord.Selection.Goto(wdGoToBookMark,"RegisName"). But the insertion point doesn't go the the bookmark named RegisName.
>

In fact, once you know that a bookmark exists, you don't need to use Goto. Just address it directly in the Bookmarks collection:

oRange = oWord.ActiveDocument.Bookmarks("RegisName")

However, if you really want to use Goto, the secret is to omit the parameters that aren't in the macro.

Tamar
Previous
Reply
Map
View

Click here to load this message in the networking platform