Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Having trouble with Automating Goto in MS Word
Message
De
29/03/2001 16:11:29
Bill Drew
Independent Consultant
Chicago, Illinois, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Having trouble with Automating Goto in MS Word
Divers
Thread ID:
00490068
Message ID:
00490068
Vues:
35
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
Fil
Voir

Click here to load this message in the networking platform