#1
|
|||
|
|||
Use VBA to create checkboxes and text boxes in Word
I would like to create a table with two columns, one on the left with ActiveX Check Box in every cell, and on the right, ActiveX Text Box in every cell. The number of rows will be determined by yet another ActiveX Text Box on the same Word document.
So the workflow for the user would be: Enter number of rows in one text box-> click Generate Rows button -> Word document refreshes, now showing the two-column-table with the selected number of rows. Is there a way to create this table in Word? I know it is possible in Excel but I am not familiar with the way these controls are created in Word. Thanks in advance everyone. |
#2
|
||||
|
||||
Why ActiveX Check Boxes? These aren't supported on Macs, for example, and revert to their default settings when the document is closed.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Yep, our firm is Windows based and the reset is OK for the usage of this form. However, if you know of a better way to do this with another type of checkbox, could you let me know? Thanks again.
|
#4
|
||||
|
||||
You would do far better to use content controls. For the kind of project you're describing, see, for example:
https://www.msofficeforums.com/word-...html#post87989 https://www.msofficeforums.com/word-...html#post38461 https://www.msofficeforums.com/word-...tml#post145675
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Thanks for those links. I think the most similar to my project is the third link (https://www.msofficeforums.com/word-...tml#post145675). I would like to be able to have one column of checkboxes and another of text fields, as I described above. Should I be avoiding ActiveX elements? Also, could you explain what the DoDependent sub does so I can replicate it for my project?
Thanks again. |
#6
|
|||
|
|||
Got it working with the regular checkboxes. Found one of your posts on another MS Word forum! Thanks macropod!
|
#7
|
||||
|
||||
Quote:
They have their place but, as shown in the links, aren't needed for what you're doing.The DoDependent sub looks at what choices have been made in the ProcessType & EquipCategory dropdowns and based on that, populate the corresponding TestType and Component dropdowns with the applicable choices. The data for those choices are stored in the ProcessType & EquipCategory dropdown values as |-delimited strings.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Auto Create/Format a Word Document based on Check Boxes | shanerolle | Word VBA | 21 | 05-13-2020 10:42 AM |
Need Macro to select Checkbox after two boxes are checked in a series of checkboxes | rsaini | Word VBA | 0 | 01-16-2018 11:57 AM |
Word 2013 Text boxes on everything, can't select across multiple boxes | 1Kurgan1 | Word | 2 | 10-31-2016 01:20 AM |
Text inside text boxes create headings inside my table of contents!!! How do I delete the created he | carstj | Word | 3 | 04-11-2016 12:46 PM |
Attempting to create "linked" text boxes | EricL89 | Word | 1 | 02-21-2014 05:36 PM |