Two instances of AdxRibbonContextMenu

Add-in Express™ Support Service
That's what is more important than anything else

Two instances of AdxRibbonContextMenu
 
Hannes Koidl




Posts: 320
Joined: 2008-05-19
Hi Guys,

i try to add some context menues. In my solution there is already a context menu for mailitems.

Code in desiner looks like:

this.m_RibbonContextMenu.ContextMenuNames.AddRange(new string[] {
"Outlook.Explorer.ContextMenuMailItem",
"Outlook.Explorer.ContextMenuMultipleItems"});
this.m_RibbonContextMenu.Controls.Add(this.mr_popupContextMenu);
this.m_RibbonContextMenu.Ribbons = AddinExpress.MSO.ADXRibbons.msrOutlookExplorer;

It is activated for Explorer and MailItem.

Now i want to add a second ContextMenu - this time for Attachments. But, as soon as i enable the second contextmenu also for Explorer, all menues are gone:

this.m_RibbonAttachmentContextMenu.ContextMenuNames.AddRange(new string[] {
"Outlook.Mail.Read.ContextMenuAttachments",
"Outlook.Explorer.ContextMenuAttachments"});
this.m_RibbonAttachmentContextMenu.Controls.Add(this.mr_popupAttachmentContextMenu);
this.m_RibbonAttachmentContextMenu.Ribbons = ((AddinExpress.MSO.ADXRibbons)(((AddinExpress.MSO.ADXRibbons.msrOutlookMailRead | AddinExpress.MSO.ADXRibbons.msrOutlookMailCompose)
| AddinExpress.MSO.ADXRibbons.msrOutlookExplorer)));

If i remove AddinExpress.MSO.ADXRibbons.msrOutlookExplorer, then all menues show up - but here i want a second context which is available for attachments.

As soon as i check AddinExpress.MSO.ADXRibbons.msrOutlookExplorer - all my menues and bars are gone?

Outlook 2010 64bit
Latest ADX release
Posted 22 Feb, 2011 14:29:24 Top
Hannes Koidl




Posts: 320
Joined: 2008-05-19
Sorry Guys - solved that. I had two RibbonButtons with the same ID - that made all bars disappear - some exception or dubplicate check would help to find that issue sooner! ;)
Posted 22 Feb, 2011 15:22:32 Top
Hannes Koidl




Posts: 320
Joined: 2008-05-19
Ok - got the click event now - but how to get the underlaying attachment now?
Posted 22 Feb, 2011 15:30:37 Top
Hannes Koidl




Posts: 320
Joined: 2008-05-19
already got it - sorry guys - casting control.Context to attachmentselection...
Posted 22 Feb, 2011 16:11:15 Top
Eugene Astafiev


Guest


Hi Hannes,

Thank you for letting me know. You broke the ice! Good luck with your add-in project!
Posted 23 Feb, 2011 06:25:32 Top