You can use the following code to test the function:
Public Sub TestAddComboBoxToCommandBar ()
'Purpose: test the AddComboBoxToCommandBar function.
Dim strChoices (4) As String
StrChoices (1) = "Vanilla"
StrChoices (2) = "Chocolate"
StrChoices (3) = "Strawberry"
StrChoices (4) = "Other"
If AddComboBoxToCommandBar ("Tools", "Favorite Ice Cream ",_
StrChoices) = True Then
MsgBox "combo box is successfully added. "
Else
MsgBox "failed to add the combo box. "
End If
End Sub
Disable and hide the command bar and command bar controls
When developing an Office solution, you may need to prevent users from clicking on some command bar and command bar controls associated with the solution. For example, you may need to prevent users from clicking any controls on the "forms" toolbar to modify the Custom forms you have created in Microsoft Word. You may also need to disable the macro command on the Tools menu for the given solution.
Set the Enabled attribute of the command bar or command bar control to False to disable the command bar or command bar control. Similarly, set the Enabled attribute of the command bar or command bar control to True to enable the command bar or command bar control.