Hello everyone,
I am working with a document that has a User Form with several texboxes on it that simply populates the information typed in to them at bookmark locations set in the document. I have this working for a drop-down box as well without any issues.
The issue I am having is in reference to a Multi-select list box.
I have a multi-select listbox with the options being populated using code list this:
With ListBox1
.AddItem "Option 1"
.AddItem "Option 2"
.AddItem "Option 3"
I have logical expressions setup to determine which building blocks should be used based of the selections using gmayor's code that I found on here for filling bookmarks with building blocks (fcnFillBMwithBB) which look like this:
If Listbox1.Value = "Example 1" Then
fcnFillBMwithBB "bmContent", "Example.dotm", 9, "General", "BB1 Name"
ElseIf Listbox1.Value = "Example 2" Then
fcnFillBMwithBB "bmContent", "Example.dotm", 9, "General", "BB2 Name"
ElseIf Listbox1.Value = "Example 3" Then
fcnFillBMwithBB "bmContent", "Example.dotm", 9, "General", "BB3 Name"
End If
The question I have is, what code would I use to look through all the options selected in the listbox and populate the different building blocks associated with each item at a bookmark on different lines. Any help would be greatly appreciated!