Disable plugin for outlook shell extension right click mode

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

Disable plugin for outlook shell extension right click mode
 
alon k


Guest


Hi,

I have an outlook plugin that works just great with all outlook versions. The plugin has buttons that are shown for the user when he opens a new mail for sending.

The problems starts when a user uses the windows explorer shell extension to send a mail by using "Send to" -> "Mail recipient". When I try to save or move this mail using MailItem.Save() or MAilItem.Move() I get COMException saying that these operations are not allowed.

Error trace:
---------------------------
Application Domain: C:\Workspace\dev\App\Products\sne\AgentOutlookAddIn\AgentOutlookAddIn\bin\Release\
Assembly Codebase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.Office.Interop.Outlook/14.0.0.0__71e9bce111e9429c/Microsoft.Office.Interop.Outlook.dll
Assembly Full Name: Microsoft.Office.Interop.Outlook, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
Assembly Version: 14.0.0.0

Exception Source: Microsoft Outlook
Exception Type: System.Runtime.InteropServices.COMException
Exception Message: Could not complete the operation because the service provider does not support it.
Exception Target Site: Copy

---- Stack Trace ----
Microsoft.Office.Interop.Outlook._MailItem.Copy()
Microsoft.Office.Interop.Outlook.dll: N 00000 (0x0) JIT
AgentOutlookAddIn.ComAccessors.MailItemAccessor.Copy()
-------------------------------------------------------------

Im not sure this is something to do with add in express, but Id like to know if someone already overcome these issues, and if there is a way to disable my plugin at all for this mode..

Regards,
Alon
Posted 22 Feb, 2015 09:35:25 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello Alon,

Could you please confirm that just calling MailItem.Save causes the exception for you? This doesn't occur for me in Outlook 2013. MailItem.Copy does produce the exception.

I assume you show a Ribbon control and clicking that control in this scenario produces the exception when the event handler invokes e.g. MailItem.Copy. If so, when the PropertyChanging event occurs for that control and e.PropertyType == ADXRibbonControlPropertyType.Enabled, you can check whether e.Context refers to an Inspector object missing in the collection of Inspector objects which you will need to manage (add an item to the collection when NewInspector occurs and delete the item in the InspectorClose event); if so, you set e.Value=false and this disables the control in question.

The idea above relies on something that you need to verify: whether the Inspector objects supplied in the NewInspector and InspectorClose events are actually the same object or not.


Andrei Smolin
Add-in Express Team Leader
Posted 23 Feb, 2015 09:06:35 Top