General information
Category:
COM/DCOM and OLE Automation
Title:
Having trouble with Automating Goto in MS Word
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only