Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Table Properties
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00460713
Message ID:
00461075
Vues:
16
>I used that to make sure I was in the table. Are you saying there is another way to populate the cells in a table other than:
>with oWord.Selection.Tables(1)
>   .Cell(2,2).Range.InsertAfter("Hello World")
>   .Cell(2,3).Range.InsertAfter("Goodbye World")
>endwith
>The problem lies in having to use .Tables(1) or .Tables(2), etc.

I saw your other reply, and Garrett's solution is definitely the faster and cleaner solution! (I was under the impression that you'd be adding to an existing table.)

You may run into the similar situations, so I'll explain my answer a bit better. I'm assuming that your bookmark is somewhere in a table's cell, say oWord.Tables[1].Cell[1,1]. When you ask for the Range of the bookmark and set a variable to oBookmarkRange, you get a variable equal to oWord.Tables[1].Cell[1,1].Range. So if you've ensured oBookmarkRange is within a table with oBookmarkRange.Information(wdWithinTable), you know you've got a cell, and you can act on it just like referencing any other cell, and insert text, format, whatever needs to be done, as in oBookMark.InsertAfter("Hello World").

Hope this helps!

- della
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform