
Adding Menu item to the Mail item menu from an outlook Addin
If you have concerns about users having Macros disabled, you can implement
your solution as a COM Add-In. As for the CommandBars collection, yet, you
need to have an Inspector or Explorer object in order to access it, but that
should never be a problem. There's always an ActiveExplorer - the main
Outlook interface itself. If what you want is to add a custom menu/toolbar
item to every new Inspector, see my other post in this thread.
--
Eric Legault, MCSD
ADAPSYS - http://www.adapsys.ca
Quote:
> Jeff I have the same issue
> I have an Outlook Addin that needs to add a button to be launched to a new
> mail message, the way I do it is to
> create a new mail message so that it becomes the activeexplorer then add
the
> button on and close the message Whilst this can work this is a huge hack.
It
> seems as the commandbars are only available from
> activeexplorer/activeinspector, so you have to have one of these to access
> it. Obviously Outlook doesnt have this limitation and has registry keys to
> support this. But there must be a better way, as this way can get into
> trouble if there is a disable macro dialogue box being displayed for
> instance
> If anyone can help much appreciated
> Code
> Set objAppInstance = Application
> 'this is hacky, but cant find anyother way to do it
> Set objMessage = Application.CreateItem(olMailItem)
> objMessage.Display
> Set MyButton =
> Application.ActiveExplorer.CommandBars("standard").Controls.Add() '(1)
> > Hi guys n gals
> > I thought i might cross-post this one as it seems relevant to all....
> > I have an outlook addin in which i have added some menu items , trap
> events
> > etc. However what I now need to do is to add a menu item to the standard
> > 'file' menu when any mail item is opened (new or exisitng). I am talking
> > about the menu within the mail window.
> > I was looking at using the withevents on the inpectors object but dont
> seem
> > to be able to get anywhere.
> > How do I go about this? Any help would be appreciated.
> > Regards
> > Jeff
> > perth western australia