Martin Thoma wrote:
Hello! I have a text-document which contains some tables:
Table1 (Named "MyTable")
Table2 (Named "My 2nd Table")
I copy+paste (executeDispatch) Table1 some times into the document:
Table1 (Named "MyTable")
NewTable (Named "Table 4")
NewTable (Named "Table 5")
NewTable (Named "Table 6")
NewTable (Named "Table 7")
Table2 (Named "My 2nd Table")
What I need is to access the NewTables in the right order.
I tried to use getTextTables, because I thought it returns the tables in the
order they are in to document, but it gives:
Table1 (Named "MyTable")
Table2 (Named "My 2nd Table")
NewTable (Named "Table 4")
NewTable (Named "Table 5")
NewTable (Named "Table 6")
NewTable (Named "Table 7")
I coulnd't rely on the table-name, because I don't know which tables are
already inside the document.
My idea now is to store all table-names before the copy+paste, use
getTextTables and compare the names with the tables-names I stored - but I
have to be sure that the first table I get will be the first I inserted
("Table 4") and not some other of the new tables (like "Table 6"). Will this
ALWAYS be the case?
Hi,
you cannot rely on the order of tables. I'd suggest to sort the names
you get from getTextTables/getElementNames to find the new table name
quickly.
If you copy/paste the table only (without surrounding text) you can
query at the view cursor for the TextTable property and then ask this
for it's name because this cursor will be located within the new table.
Regards,
Oliver
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]