More programming on the Microsoft Office command bar (1)

Source: Internet
Author: User
Tags microsoft outlook

More programming on the Microsoft Office command bar
Frank C. Rice
Microsoft Corporation
Paul Cornell
Microsoft Corporation
May 2, 2002
In the last month's column, I introduced you to the "command bar", which is in Microsoft®The user interface components used in Office, allowing you to perform operations in Office applications. Based on your feedback on the last month's column, I will introduce you to additional information and code for solving specific issues in the command bar, including:
Microsoft Outlook®How to program the command bar.
How to add custom images to the command bar button.
How to add a combo box to the command bar.
How to disable and hide the command bar and command bar controls.
How to locate the command bar.
How to dynamically add and delete the command bar.
How to list common properties of the command bar and command bar controls in a given Office application.
Command bar and Outlook Object Model
In the last month's column, I forgot to tell you how Microsoft Outlook object models access the command bar and command bar controls in a slightly different way than other Microsoft Office applications.
In applications other than Outlook, you can use the following code to access the command bar:
Public Sub ListCommandBarNames ()
'Purpose: list all command bar names of the current application.
'Note: This code is invalid for Outlook!
Dim objCommandBar As Office. CommandBar

For Each objCommandBar In Application. CommandBars

Debug. Print objCommandBar. Name

Next objCommandBar

End Sub
However, an attempt to run this code in Outlook will cause a running error. Instead, you must use the CommandBars attribute of the Explorer or Inspector object, as shown below:

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.