#1
|
|||
|
|||
Inserting text from checkboxes
Hello,
Is there another way to write the codes I have below? The idea is to insert the text shown in the text box including "and" if there are multiple entries. If Me.Chbx2 = True And Me.Chbx3 = True And Me.Chbx4 = True And Me.Chbx5 = True And Me.Chbx6 = True Then Selection.GoTo What:=wdGoToBookmark, Name:="First" With ActiveDocument.Bookmarks .DefaultSorting = wdSortByName .ShowHidden = True End With Selection.TypeText Text:=" CheckBox2, " Selection.TypeText Text:="CheckBox3, CheckBox4, CheckBox5 and CheckBox6" OR if the below is my selection If Me.Chbx2 = True And Me.Chbx3 = False And Me.Chbx4 = True And Me.Chbx5 = And Me.Chbx6 = True Then Selection.GoTo What:=wdGoToBookmark, Name:="First" With ActiveDocument.Bookmarks .DefaultSorting = wdSortByName .ShowHidden = True End With Selection.TypeText Text:=" CheckBox2, CheckBox4 and CheckBox6" Thanks in advance. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UserForm with checkboxes that hide/show bookmarked text in document | dohertym | Word VBA | 4 | 05-16-2022 09:48 PM |
Use VBA to create checkboxes and text boxes in Word | rotunda | Word VBA | 6 | 06-16-2021 03:13 PM |
Macro-inserting text box | BLUEPUPIL | Word VBA | 14 | 04-16-2018 06:59 AM |
Inserting and rearranging text by inspecting existing text | rok123 | Word VBA | 9 | 02-05-2016 07:31 PM |
Mutually exclusive checkboxes with text | jt3writer | Word VBA | 2 | 01-21-2015 12:41 PM |