Right-mouse context menu in Outlook

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

Right-mouse context menu in Outlook
 
Philip Street




Posts: 53
Joined: 2005-01-25
I am trying to create a context-menu in Outlook for when the user right-mouse clicks on an email in a mail folder - I want a "Save As Record..." menu option to appear between the Open and Print menu options.

I tried to use your Sample Add-in (for menu options) as a starting point but am not sure which Office ID to use for the CommandBarPopup.Id property. Here's my code;

'AdxCommandBarPopup5
'
Me.AdxCommandBarPopup5.Caption = "AdxCommandBarPopup5.Caption"
Me.AdxCommandBarPopup5.Controls.Add(Me.AdxCommandBarButton5)
Me.AdxCommandBarPopup5.ControlTag = "dc9dab62-ef4d-4b62-b9aa-c99b540bbcf4"
Me.AdxCommandBarPopup5.Id = 32768
Me.AdxCommandBarPopup5.Temporary = True
Me.AdxCommandBarPopup5.UpdateCounter = 2
'
'AdxCommandBarButton5
'
Me.AdxCommandBarButton5.Caption = "AdxCommandBarButton5.Caption"
Me.AdxCommandBarButton5.ControlTag = "ccbd6343-0636-4c87-9208-bea8f8e9f4cd"
Me.AdxCommandBarButton5.ImageTransparentColor = _
System.Drawing.Color.Transparent
Me.AdxCommandBarButton5.Temporary = True
Me.AdxCommandBarButton5.UpdateCounter = 1

Using the BuiltInControlsScanner.exe I can see that the "Context Menu" Popup Command Bar does not have an Office ID, so am using the Office ID of the "&Open" Button.

What am I doing wrong, or am I not able to extend the context-menu in Outlook?

Cheers,

Phil
Posted 28 Jan, 2005 09:18:55 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Phil,

To add your controls to the Outlook context menu you should use
the Office.ICommandBarsEvents interface. The fact is that the Outlook Context Menu is a dynamic menu. You can modify it while Outlook command bars is updated. How it can be done you can see it in the HOWTOs section on our web site (HOWTO #6).
http://www.add-in-express.com/support/addin-c-sharp.php
Posted 28 Jan, 2005 10:26:46 Top
Philip Street




Posts: 53
Joined: 2005-01-25
Sergey,

OK, I'll give it a try!

Cheers,

Phil
Posted 28 Jan, 2005 10:29:47 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Phil,
Sorry, I gave you the C# link to the HOWTOs section.
See here: http://www.add-in-express.com/support/addin-vb-net.php
Posted 28 Jan, 2005 10:31:36 Top
Philip Street




Posts: 53
Joined: 2005-01-25
Sergey,

Yep, I spotted that... :-)

A couple things;

1) Any idea how I position my CommandBarButton, i.e. so that it's the second option on the menu?

2) This is a general request - do you have updated documentation for the component? The latest PDF appears to be from October last year.

Cheers,

Phil
Posted 28 Jan, 2005 11:36:50 Top
Philip Street




Posts: 53
Joined: 2005-01-25
Sergey,

Any thoughts on my previous post?

Cheers,

Phil
Posted 31 Jan, 2005 12:40:03 Top
Philip Street




Posts: 53
Joined: 2005-01-25
Any idea how I position my CommandBarButton, i.e. so that it's the second option on the menu?


Will this be fixed by the BeforeID and AfterID properties you due to release in the next Build?

If not, any ideas how I can do this?

Cheers,

Phil
Posted 01 Feb, 2005 09:12:11 Top
Eugene Starostin


ADX Team
Add-in Express team


Posts: 430
Joined: 2004-04-05
No. Unfortunatelly, the context menu in Outlook is a dinamic thing which doesn't allow us to connect to it statically.

But I see that we must work out something in one of premium builds after version 2.2. I will inform you if we find out a solution.
Posted 01 Feb, 2005 09:23:15 Top
Philip Street




Posts: 53
Joined: 2005-01-25
Eugene,

Fair enough, that would be nice. :-)

Phil
Posted 01 Feb, 2005 09:34:29 Top