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
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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