CommandBars collection in Outlook

  • Thread starter Thread starter mml
  • Start date Start date
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
 
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
 
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
 
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
 
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
 
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
 
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
 
Back
Top