Return set variable details

A

Alan @ealing

We have a very comlex document containing 22 tables. As part of the coding we
have a small macro that tells you the table, row and column of the cursor
position. Is there any way, as these tables are all set as named objects to
return the name of that too, eg
Set TableM1 = ActiveDocument.Tables(1) [ideal return] "TableM1"
 
J

Jean-Guy Marcil

Alan @ealing was telling us:
Alan @ealing nous racontait que :
We have a very comlex document containing 22 tables. As part of the
coding we have a small macro that tells you the table, row and column
of the cursor position. Is there any way, as these tables are all set
as named objects to return the name of that too, eg
Set TableM1 = ActiveDocument.Tables(1) [ideal return] "TableM1"

The way I see it, in your example, TableM1 is not the name of the table, but
the name of the pointer that points to the first table in the document.
In fact, as soon as your code finishes executing, TableM1 "dies." Word
tables do not have names.
One way around that is to hold the table in a bookmark and used that as a
name.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
[email protected]
Word MVP site: http://www.word.mvps.org
 
Top