Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
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.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement