Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Table Properties
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00460713
Message ID:
00461485
Views:
16
Della,
Assuming that I have a table (nTable) with a bookmark in Cell[1,1], you say that the oBookmarkRange variable is equal to oWord.Tables[nTable].Cell[1,1].Range. Is there a simple way of going from there to a variable oWord.Tables[nTable]? Assuming (as earlier in the thread) that you don't know the table #? I have an app. with a lot of Word automation, including multiple tables, and every so often the client will add a table into the original template, which upsets the table numbering. Since I'm doing some fairly elaborate formatting in the tables I'd really like to get the oWord.Tables(nTable) object in a simple manner.

TIA
Barbara


>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
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform