View Single Post
  #1  
Old January 27th 09, 02:36 PM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 9
Default Context Menu on items

Hello,

I developed an add-in to show a Context Menu on item right-click.

This was developed using Extensibility.IDTExtensibility2 interface in
Visual Studio, using the Microsoft Office 10.0 Library.

The add-in works fine on Office XP...any time I right-click an item,
it shows a context menu with an added button.

The weird thing happens on Office 2007... when I first right click the
context menu shows correctly. Then if I right-click immediately on
other items the menu doesn't always shows up with the added
button...instead if I wait at least three seconds between each right
click the context menu ALWAYS shows up correctly.

What could it be? I tried logging and debugging but I cannot solve the
issue.

Thank you,
Ivan

Here I post a snippet of my code:

Private Sub ActiveExplorerCBars_OnUpdate() Handles
_ActiveExplorerBars.OnUpdate

If _IgnoreCommandbarsChanges Then Exit Sub

If _ActiveExplorerBars.Item("Context Menu") IsNot Nothing Then
If _outApp.ActiveExplorer.Selection.Count 0 Then
If _outApp.ActiveExplorer.Selection.Item(1).Class =
Outlook.OlObjectClass.olMail Then
AddContextButton(_ActiveExplorerBars.Item("Context
Menu"))
End If
End If
End If

End Sub
Ads