P
Paulem0071
All,
I am using a CustomTaskPane (CTP) wth Outlook 2007 and VSTO. The CTP loads
as a sidebar on the right side of the screen.
My issue is that sometimes two of the CTPs load. Here is my ThisAddIn_Startup
code (note the attempts at prevention of duplcate CTPS)
Outlook.Explorer explorer = this.Application.ActiveExplorer();
if (this.CustomTaskPanes.Count > 0)
{
foreach (Microsoft.Office.Tools.CustomTaskPane ctp in
this.CustomTaskPanes)
{
//if already here, use it
if (ctp.Title == "MyTitle")
{
myCustomTaskPane = ctp;
}
}
}
else
{
//make a new one only if one does not exist
if (taskPane == null)
{
taskPane = new MyTaskPane();
myCustomTaskPane = this.CustomTaskPanes.Add(taskPane,
"MyTitle", explorer);
}
}
Thanks for any advice in advance!
I am using a CustomTaskPane (CTP) wth Outlook 2007 and VSTO. The CTP loads
as a sidebar on the right side of the screen.
My issue is that sometimes two of the CTPs load. Here is my ThisAddIn_Startup
code (note the attempts at prevention of duplcate CTPS)
Outlook.Explorer explorer = this.Application.ActiveExplorer();
if (this.CustomTaskPanes.Count > 0)
{
foreach (Microsoft.Office.Tools.CustomTaskPane ctp in
this.CustomTaskPanes)
{
//if already here, use it
if (ctp.Title == "MyTitle")
{
myCustomTaskPane = ctp;
}
}
}
else
{
//make a new one only if one does not exist
if (taskPane == null)
{
taskPane = new MyTaskPane();
myCustomTaskPane = this.CustomTaskPanes.Add(taskPane,
"MyTitle", explorer);
}
}
Thanks for any advice in advance!