Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-14-2021, 10:40 AM
rotunda rotunda is offline Use VBA to create checkboxes and text boxes in Word Windows 10 Use VBA to create checkboxes and text boxes in Word Office 2019
Novice
Use VBA to create checkboxes and text boxes in Word
 
Join Date: Jun 2021
Posts: 6
rotunda is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 06-14-2021, 03:15 PM
macropod's Avatar
macropod macropod is offline Use VBA to create checkboxes and text boxes in Word Windows 10 Use VBA to create checkboxes and text boxes in Word Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #3  
Old 06-15-2021, 06:16 AM
rotunda rotunda is offline Use VBA to create checkboxes and text boxes in Word Windows 10 Use VBA to create checkboxes and text boxes in Word Office 2019
Novice
Use VBA to create checkboxes and text boxes in Word
 
Join Date: Jun 2021
Posts: 6
rotunda is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Why ActiveX Check Boxes? These aren't supported on Macs, for example, and revert to their default settings when the document is closed.
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.
Reply With Quote
  #4  
Old 06-15-2021, 08:06 AM
macropod's Avatar
macropod macropod is offline Use VBA to create checkboxes and text boxes in Word Windows 10 Use VBA to create checkboxes and text boxes in Word Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #5  
Old 06-16-2021, 08:03 AM
rotunda rotunda is offline Use VBA to create checkboxes and text boxes in Word Windows 10 Use VBA to create checkboxes and text boxes in Word Office 2019
Novice
Use VBA to create checkboxes and text boxes in Word
 
Join Date: Jun 2021
Posts: 6
rotunda is on a distinguished road
Default

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.
Reply With Quote
  #6  
Old 06-16-2021, 12:33 PM
rotunda rotunda is offline Use VBA to create checkboxes and text boxes in Word Windows 10 Use VBA to create checkboxes and text boxes in Word Office 2019
Novice
Use VBA to create checkboxes and text boxes in Word
 
Join Date: Jun 2021
Posts: 6
rotunda is on a distinguished road
Default

Got it working with the regular checkboxes. Found one of your posts on another MS Word forum! Thanks macropod!
Reply With Quote
  #7  
Old 06-16-2021, 03:13 PM
macropod's Avatar
macropod macropod is offline Use VBA to create checkboxes and text boxes in Word Windows 10 Use VBA to create checkboxes and text boxes in Word Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by rotunda View Post
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.
I assume by 'text fields', you actually mean text content controls. You shouldn't use formfields and content controls in the same document.
Quote:
Originally Posted by rotunda View Post
Should I be avoiding ActiveX elements?
They have their place but, as shown in the links, aren't needed for what you're doing.
Quote:
Originally Posted by rotunda View Post
Also, could you explain what the DoDependent sub does so I can replicate it for my project?
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]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use VBA to create checkboxes and text boxes in Word 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
Use VBA to create checkboxes and text boxes in Word 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

Other Forums: Access Forums

All times are GMT -7. The time now is 03:54 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft