CommandBars collection in Outlook

M

mml

Hi,

Does anybody know how to add a CommandBar Button in Outlook 2000 by code ?

The CommandBar(s) collection and item don't seem to be recognized by
Outlook, although Access knows them...

Marc
 
S

Sue Mosher [MVP-Outlook]

If you look in the object browser, you'll see that in Outlook, CommandBars is a child object of the Inspector and Explorer window objects, not the Application object. See http://www.outlookcode.com/d/tips/commandbarfun.htm

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
M

mml

Thank you for your help.
But now, by code, I try to link the new button with lines of code on the "on
click" event, but I don't succeed .
Can you help me ?

Best regards.



"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de If you look in the object browser, you'll see that in Outlook, CommandBars
is a child object of the Inspector and Explorer window objects, not the
Application object. See http://www.outlookcode.com/d/tips/commandbarfun.htm

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

Did you look at the Items Command Bar sample from that page? It's a great COM add-in example of adding a toolbar button.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


mml said:
Thank you for your help.
But now, by code, I try to link the new button with lines of code on the "on
click" event, but I don't succeed .
Can you help me ?

Best regards.



"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de If you look in the object browser, you'll see that in Outlook, CommandBars
is a child object of the Inspector and Explorer window objects, not the
Application object. See http://www.outlookcode.com/d/tips/commandbarfun.htm

mml said:
Hi,

Does anybody know how to add a CommandBar Button in Outlook 2000 by code ?

The CommandBar(s) collection and item don't seem to be recognized by
Outlook, although Access knows them...

Marc
 
M

mml

Hi,

Thanks a lot for your good messages. I think I'm near the happiness.

The ".OnAction" of my button must call an executable file (.exe) and I dont
find the right syntax for that.
Can you help me ?

Best regards.
MML

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de Did you look at the Items Command Bar sample from that page? It's a great
COM add-in example of adding a toolbar button.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


mml said:
Thank you for your help.
But now, by code, I try to link the new button with lines of code on the "on
click" event, but I don't succeed .
Can you help me ?

Best regards.



"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de If you look in the object browser, you'll see that in Outlook, CommandBars
is a child object of the Inspector and Explorer window objects, not the
Application object. See http://www.outlookcode.com/d/tips/commandbarfun.htm

mml said:
Hi,

Does anybody know how to add a CommandBar Button in Outlook 2000 by code ?

The CommandBar(s) collection and item don't seem to be recognized by
Outlook, although Access knows them...

Marc
 
S

Sue Mosher [MVP-Outlook]

OnAction is the wrong property if you want to run an .exe. Use OnAction to run a VBA macro or to associate the button with a COM add-in.

To run an .exe, set the CommandBarButton.HyperlinkType property to msoCommandBarButtonHyperlinkOpen [= 1] and put the path to the .exe file in the TooltipText property.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
M

mml

YES, It works fine !!!!!

Thanks a lot !



"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de OnAction is the wrong property if you want to run an .exe. Use OnAction to
run a VBA macro or to associate the button with a COM add-in.

To run an .exe, set the CommandBarButton.HyperlinkType property to
msoCommandBarButtonHyperlinkOpen [= 1] and put the path to the .exe file in
the TooltipText property.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top