More programming on the Microsoft Office command bar (2)

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.