More programming on the Microsoft Office Command bar (1)
Source: Internet
Author: User
More programming on the Microsoft Office Command bar
Frank C. Rice
Microsoft Corporation
Paul Cornell
Microsoft Corporation
May 2, 2002
In last month's column (English), I introduced you to the "command bar", which is a user interface component used in Microsoft® Office, enables users 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:
How does Microsoft Outlook® process the command bar programmatically.
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:
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