Hiding/showing a table with VBA

A

AmandaH

Hello all,

I am trying to find out for I can trun a table on or off depending on a
yes/no answer from a form field. I am using Word 2003 and the VBA that
comes with it. Any ideas/links would be of great help.

~Amanda~
 
M

macropod

Hi Amanda,

You don't need vba for this.

The solution is to:
.. select the table
.. press Ctrl-F9 to enclose it in a field
.. just before the table, press Ctrl-F9 again, to insert another field
.. fill in the field so that they look like type {IF{BkMrk \* Caps}= "Y*"
Table}
where 'BkMrk' is the bookmark name assigned to your formfield and 'Table'
is your table
.. use 'N' instead of 'Y' above if the table is meant to appear in response
to a 'no' answer
.. set the formfield's properties to 'calculate on exit'

Cheers
 
C

Cindy M -WordMVP-

Hi AmandaH,
I am trying to find out for I can trun a table on or off depending on a
yes/no answer from a form field. I am using Word 2003 and the VBA that
comes with it.
You can format the table with a specific style. The code for the On Exit
property of the checkbox change the styles' FONT.Hidden property to true
(or false). this works without turning off document protection.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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