Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Moving to a Bookmark in word document thru VFP
Message
De
24/05/2002 13:31:56
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00661042
Message ID:
00661177
Vues:
73
>Can somebody help me to move the cursor in a word document to a bookmark. I tried "oWord.Selection.GoTo([BookMark1])", but it doesn't work.

As Cetin pointed out, you don't need the Goto method. However, there's a good chance you don't need the Select method either. For example, if your goal is to replace the bookmark with some text, you can do it like this:

oWord.Bookmarks(YourBookmark).Range.Text = "Your Text Here"

If you'd like to work with the contents of the bookmark, you can make a range object from it and then proceed:

oRange = oWord.Bookmarks(YourBookmark).Range()
WITH oRange
* do some stuff
ENDWITH

In general, it's a good idea to avoid the Selection object and the Select method. Macros you record use them because they're mimicking user interaction, but your automation code doesn't need to do that. It can work directly with the document content without selecting it.

Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform