出於某種原因,在我的應用我FolderSwitch適用於與應用程序,但NewExplorer事件永遠不會觸發打開Explorer主,如此明顯的FolderSwitch事件將不會觸發一個新的瀏覽器。展望2010 COM插件 - NewExplorer永遠不會觸發
我不知道爲什麼事件不會觸發。
private List<_Outlook.Explorer> ListOfExplorerWindows = new List<_Outlook.Explorer> { };
private _Outlook.Application Application;
public void OnConnection(object Application, Extensibility.ext_ConnectMode ConnectMode, object AddInInst, ref Array custom)
{
this.Application = (_Outlook.Application)Application;
}
public void OnStartupComplete(ref Array custom)
{
_Outlook.Explorer Explorer = this.Application.ActiveExplorer();
Explorer.FolderSwitch += new _Outlook.ExplorerEvents_10_FolderSwitchEventHandler(Explorer_FolderSwitch);
ListOfExplorerWindows.Add(Explorer);
this.Application.Explorers.NewExplorer += new _Outlook.ExplorersEvents_NewExplorerEventHandler(Explorers_NewExplorer);
}
private void Explorers_NewExplorer(_Outlook.Explorer Explorer)
{
Explorer.FolderSwitch += new _Outlook.ExplorerEvents_10_FolderSwitchEventHandler(Explorer_FolderSwitch);
ListOfExplorerWindows.Add(Explorer);
}
其實,我可能會通過增加 私人_Outlook.Explorers探險固定它; 在課堂上的水平,但我想 私人_Outlook.Application應用程序; 會保持在範圍內,任何人都可以解釋嗎? – Matt 2012-03-02 17:35:49
我自己的信息:你在哪裏綁定到OnConnection和OnStartupComplete?什麼對象有這些事件? – 2015-09-20 16:05:23
我不認爲他們的活動,他們是IExtensibility2 – Matt 2015-09-21 08:57:02