For an addin for out look a new Custom task pane is added to a specific window using the following code:
historyPane = new HistoryPane(taskId);
customTaskPane = Globals.ThisAddIn.CustomTaskPanes.Add(historyPane, title, new Microsoft.Office.Interop.Outlook.Application().ActiveWindow());
Now I want to be able to close this customTaskpane again for the specific window, I've searched far and wide, unfortunately without any success.
I am unable to find a task pane in an active window. I've tried looking for some unique ID for a window or something to link to a dictionary and close it this way, also without any luck.
Would anyone be able to help me or point me in the good direction?