From: JuanManuel on
Is it possible to refer in code to Macrobutton fields in order to modify
their properties.

If so, how??

Just in case, let me provide the specific example. I currently have a
document with more than 200 tables. Each table has in its top row a
Macrobutton field that hides and unhides the rows from row 2 to the last one.
Furthermore, when the table is hidden, the macrobutton field becomes green if
the table is empty and red if there is something in any cell of the table.
When the table is unhidden the macrobutton is blue. Everyting I just
described is already implemented (I provide it just as a background).

What I'm planning to do now is, using another button (either activeX or
macrobutton) placed at the top of the document, to hide or unhide all the
tables in the document at once and format each of the macrobutton in each
table accordingly.

I already wrote the code of this top button and it does hide or unhide all
the tables in the document. The only problem is that it does not change the
background color of the macrobuttons in each table.

Can this be accomplished?
From: macropod on
Hi Juan,

I'd suggest using a loop to test the contents of each table before hiding and changing the Macrobutton field colours then.

The alternative would be to programmatically trigger each macrobutton to hide its table and use the existing code to determine the
colour. Doing it that way might be somewhat slower, though.

--
Cheers
--
macropod
[MVP - Microsoft Word]


"JuanManuel" <JuanManuel(a)discussions.microsoft.com> wrote in message news:65C8F8B7-21B7-4B86-BACA-EFA9739EA555(a)microsoft.com...
> Is it possible to refer in code to Macrobutton fields in order to modify
> their properties.
>
> If so, how??
>
> Just in case, let me provide the specific example. I currently have a
> document with more than 200 tables. Each table has in its top row a
> Macrobutton field that hides and unhides the rows from row 2 to the last one.
> Furthermore, when the table is hidden, the macrobutton field becomes green if
> the table is empty and red if there is something in any cell of the table.
> When the table is unhidden the macrobutton is blue. Everyting I just
> described is already implemented (I provide it just as a background).
>
> What I'm planning to do now is, using another button (either activeX or
> macrobutton) placed at the top of the document, to hide or unhide all the
> tables in the document at once and format each of the macrobutton in each
> table accordingly.
>
> I already wrote the code of this top button and it does hide or unhide all
> the tables in the document. The only problem is that it does not change the
> background color of the macrobuttons in each table.
>
> Can this be accomplished?