PDA

View Full Version : [SOLVED:] How to isolate the table in its own section



kristopherca
10-01-2024, 11:49 PM
Hello,
I have a document with 5 sections. Each section is a particular table that I reference with some Macros. Editing regularly the base document and adding tables above or below the table in question cause me a little problem. I wonder if I can isolate this table in its own section, and then search only that section for the correct table. I'm not sure how to identify the first table in a given section.

Hope that someone can give me some advice!


Thanks in advance!

Aussiebear
10-02-2024, 01:03 AM
Have you considered giving each table a "name", so as to be able to identify it correctly?

macropod
10-02-2024, 05:22 PM
You could insert Section breaks either side of that table...

So, for example, if the table in question is in Section 3 and a new Section break is inserted before it, the table can then be referred to via:

Activedocument.Sections(4).Range.Tables(1)

kristopherca
10-02-2024, 08:35 PM
You could insert Section breaks either side of that table...
Thanks for your suggestion. I got it.:thumb