Forum Discussion
Jay_Cous To do it actually in the document, you would need to use an ActiveX ListBox that can be inserted via the Legacy Forms in the Controls section of the Developer tab of the ribbon.
with its ListStyle property set to 1 - frmListStyleOption and the MultiSelect property set to frmMultiSelectMulti.
However, depending upon what you want to do with the selected items, using an ActiveX checkbox will probably not be satisfactory and it will almost certainly be better to make use of a UserForm.
- May 05, 2022
Jay_Cous Save the document as a Macro Enabled Template (*.dotm) and in the ThisDocument object, set up the following code
Private Sub Document_New()
Dim i As Long
With ListBox1
.Clear
For i = 1 To 10
.AddItem "Item " & i
Next i
End With
End Sub- Jay_CousMay 05, 2022Copper ContributorHello Doug. Am not an expert user of word. Are you able to provide all the steps on how to do this. For instance, Have created the Active X, then created the above script as above and my box is still empty and am unable to create a list of options in it. When creating the above, went into Visual Basic > Project > Microsoft Word Objects > ThisDocument and pasted what you suggested. But all I got was a blank box.
- May 05, 2022Did you save the file as a Macro Enabled Template (*.dotm) and then after closing that file, use File>New and select that Template to create a new document from it. When you do that, any macro with the name of Document_New will run.
If you cannot get it to work, upload a copy of the document so that we can check it.