Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Having trouble with Automating Goto in MS Word
Message
From
29/03/2001 16:11:29
Bill Drew
Independent Consultant
Chicago, Illinois, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Having trouble with Automating Goto in MS Word
Miscellaneous
Thread ID:
00490068
Message ID:
00490068
Views:
36
I have created a Word Object in Fox Pro, can open a document, can search and replace, print, save, etc. But I'm having trouble with goto using bookmarks.

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.

When I used the object browser, there are four arguments to Selection.Goto. They are expressed as ([What],[Which],[Count],[Name]). Tamar Granor and Della Martin warn that the order of the parameters can sometimes be hard to figure out from reading the recorded macro.

Does anyone know what these 4 parameters are, what their order are, and if they are all necessary. I assume that What is 'wdGoToBookmark', and Name is "RegisName". But I worry that Which and Count may also be necessary.
Next
Reply
Map
View

Click here to load this message in the networking platform