markbristoll
07-23-2010, 10:56 AM
I have created a mail merge document with a drop-down combo box that will be used by the user after the document has merged.
When I merge the documents the options in the combo box are not available to the user.When I switch to design view, within the merged document, the vba code I wrote is gone.
Can someone advise on how i can have the vba code available for use in the merged document.
The code I am using is as follows:
Public Sub ComboBox1_Change()
End Sub
Public Sub ComboBox1_DropButtonClick()
Me.ComboBox1.List = Array("Green", "Red", "Blue")
End Sub
Public Sub Document_Open()
Dim vColor, vColors
vColors = Array("Green", "Red", "Blue")
For Each vColor In vColors
ComboBox1.AddItem vColor
ComboBox2.AddItem vColor
ComboBox3.AddItem vColor
Next
ComboBox1.ListIndex = 0
ComboBox2.ListIndex = 0
ComboBox3.ListIndex = 0
End Sub
Public Sub ComboBox2_Change()
End Sub
Public Sub ComboBox2_DropButtonClick()
Me.ComboBox2.List = Array("Green", "Red", "Blue")
End Sub
Public Sub ComboBox3_Change()
End Sub
Public Sub ComboBox3_DropButtonClick()
Me.ComboBox3.List = Array("Green", "Red", "Blue")
End Sub
All help would be appreciated.
Mark
When I merge the documents the options in the combo box are not available to the user.When I switch to design view, within the merged document, the vba code I wrote is gone.
Can someone advise on how i can have the vba code available for use in the merged document.
The code I am using is as follows:
Public Sub ComboBox1_Change()
End Sub
Public Sub ComboBox1_DropButtonClick()
Me.ComboBox1.List = Array("Green", "Red", "Blue")
End Sub
Public Sub Document_Open()
Dim vColor, vColors
vColors = Array("Green", "Red", "Blue")
For Each vColor In vColors
ComboBox1.AddItem vColor
ComboBox2.AddItem vColor
ComboBox3.AddItem vColor
Next
ComboBox1.ListIndex = 0
ComboBox2.ListIndex = 0
ComboBox3.ListIndex = 0
End Sub
Public Sub ComboBox2_Change()
End Sub
Public Sub ComboBox2_DropButtonClick()
Me.ComboBox2.List = Array("Green", "Red", "Blue")
End Sub
Public Sub ComboBox3_Change()
End Sub
Public Sub ComboBox3_DropButtonClick()
Me.ComboBox3.List = Array("Green", "Red", "Blue")
End Sub
All help would be appreciated.
Mark