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

Click here to load this message in the networking platform