Identifying the Current table

B

Bosun

I'm a bit new at Word 2000 Vba, and after some initial success I find I need
to identify a table that follows an item of text. Having found the text, I
can move the selection forward until Selection.Information(wdWithInTable) is
True. The question is how do I refer to that table? How do I find the
current table's index number within the Tables Collection sot hat I can
process data it contains?

I'm sure I've missed something simple

Adrian
 
M

Mark Mulvany

Bosun said:
I'm a bit new at Word 2000 Vba, and after some initial success I find I need
to identify a table that follows an item of text. Having found the text, I
can move the selection forward until Selection.Information(wdWithInTable) is
True. The question is how do I refer to that table? How do I find the
current table's index number within the Tables Collection sot hat I can
process data it contains?

I'm sure I've missed something simple

Adrian

I have dabbled a little in this area. I am a little rusty however.

To access a table I have used: "Selection.Tables.Item(1).Cell(... etc...
Most collections have a variable ".Count" for the total number in the
collection.
I think that you need to draw the Item number out or use the Count property
to get the number of the last table, if you know it is the last one.

You can set up a loop to iterate through all Tables in the collection.

Sorry to be vague but a little experimentation should get you there!

Mark Mulvany
 
B

Bosun

Thanks Mark

I'm happy with reading/writing into a table. My problem is how to find the
identity of a table once I'm in it. Consider a document created by a third
party with a variable number of tables, all I know is that the table I want
to read is just after a title line "XYZ" (say), so I can find XYZ and move
selection forward a word at a time until I'm in the table ie.
selection.information(wdWithInTabl) is true. How do I refer to that
particular table? What is its index number in the tables collection? or can
I assign the current table to an object variable?

Adrian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top