0
我開發一個插件前景與VSTO,我試圖把一個單獨的表格區域顯示爲在打開檢查當前表單頁面,但拋出異常。這裏是代碼提前C#的Outlook外接setCurrentFormPage拋出異常
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
this.Application.Inspectors.NewInspector += InspectorsOnNewInspector;
this.Application.Explorers.NewExplorer += Explorers_NewExplorer;
}
private void Explorers_NewExplorer(Outlook.Explorer explorer)
{
}
private void InspectorsOnNewInspector(Outlook.Inspector inspector)
{
MessageBox.Show("ola");
// exception ocurrs in this line
inspector.SetCurrentFormPage("OutlookAddIn.RequestFormRegion");
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}
感謝。
你可能想使taskItem全局/類變量工作 - 否則,如果avriable得到NewInspector間垃圾收集Open事件將不會觸發和Open事件。 –