Hi all
I am having problems removing a callback to Outlook selection object VS 2k3 - outlook 2k3 - outlook PIA and Office core.
Since VS doesnt seem to support debugging outlook as a remote app i am having trouble working out what is happening.
The add works fine - but the remove throws a
"Microsoft.Office.Interop.Outlook.ExplorerEvents_10_EventProvider.Remove_SelectionChange(ExplorerEvents_10_SelectionChangeEventHandler) Object reference not set to an instance of an object".
I thought the command finding the explorer was failing - so i made that global in the class - and set on startup - didnt fix tho.
// Outlook app
OI.NameSpace outlookNS = applicationObject.GetNamespace("MAPI");
// Get the explorer object
OI.Explorer Explorer = outlookNS.Application.ActiveExplorer();
add code - IF BUTTONPRESS:
Explorer.SelectionChange += new OI.ExplorerEvents_10_SelectionChangeEventHandler(this.updateDtrixUI);
ELSE REMOVE:
Explorer.SelectionChange -= new OI.ExplorerEvents_10_SelectionChangeEventHandler(this.updateDtrixUI);
I am having problems removing a callback to Outlook selection object VS 2k3 - outlook 2k3 - outlook PIA and Office core.
Since VS doesnt seem to support debugging outlook as a remote app i am having trouble working out what is happening.
The add works fine - but the remove throws a
"Microsoft.Office.Interop.Outlook.ExplorerEvents_10_EventProvider.Remove_SelectionChange(ExplorerEvents_10_SelectionChangeEventHandler) Object reference not set to an instance of an object".
I thought the command finding the explorer was failing - so i made that global in the class - and set on startup - didnt fix tho.
// Outlook app
OI.NameSpace outlookNS = applicationObject.GetNamespace("MAPI");
// Get the explorer object
OI.Explorer Explorer = outlookNS.Application.ActiveExplorer();
add code - IF BUTTONPRESS:
Explorer.SelectionChange += new OI.ExplorerEvents_10_SelectionChangeEventHandler(this.updateDtrixUI);
ELSE REMOVE:
Explorer.SelectionChange -= new OI.ExplorerEvents_10_SelectionChangeEventHandler(this.updateDtrixUI);