Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a Dynamic MS Word Document

Status
Not open for further replies.

netflowdba

IS-IT--Management
Jul 7, 2011
5
US
Ok so this is what I am trying to do. I have a standard simple form I have made which allows my customers to enter information so I can submit then to sales dept.

I need to make it dynamic, so when a checkbox is clicked, a hidden table/section is displayed below it and then my users can add more details in the table. If they don't click the checkbox, the form looks standard (like before).

How do I go about doing this.

Thanks in advance.


 
I found this code but for some reason if there are other tables in the form, the checkbox picks the wrong table and not the closest one in range.

Private Sub CheckBox1_Click()
With ActiveDocument.Tables(1).Range.Font
.Hidden = Not .Hidden
End With

End Sub

How can I link it to a specific table.
 
Hi netflowdba,

First off, you need to be aware that setting a table's font to hidden prevents neither the viewing nor the printing of the table, both of which are controlled by how the user has Word configured.

As for the problem with the table acted upon, 'ActiveDocument.Tables(1)' specifically targets the first table in the document. If that's not what you want, you have to tell Word how to identify the table of interest.

Cheers
Paul Edstein
[MS MVP - Word]
 
Thanks Paul, Now I know how it was targeting the first table.
I am going to test it out again and see how it goes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top