![]() |
Multiple Instances of Add-In Loading
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! |
Multiple Instances of Add-In Loading
So you don't have multiple instances of your addin loading as your subject
says? Why not check each task pane that might exist and compare the Window property to the Explorer? Outlook 2007 allows direct comparisons of that property. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Paulem0071" wrote in message ... 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! |
Multiple Instances of Add-In Loading
Ken,
You are correct, the add-in is not loading multiple times, the CTP is. With regard to the Window property, I do not want to interfere wth any other outside CTPs, so unless I am misunderstanding your suggeston, not sure that would work. Any other ideas? Thank you. "Ken Slovak - [MVP - Outlook]" wrote: So you don't have multiple instances of your addin loading as your subject says? Why not check each task pane that might exist and compare the Window property to the Explorer? Outlook 2007 allows direct comparisons of that property. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Paulem0071" wrote in message ... 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! |
Multiple Instances of Add-In Loading
You can always compare the Window argument and once you have the correct
window just make sure it isn't your CTP that's there. Ignore any others that don't have your tags. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Paulem0071" wrote in message ... Ken, You are correct, the add-in is not loading multiple times, the CTP is. With regard to the Window property, I do not want to interfere wth any other outside CTPs, so unless I am misunderstanding your suggeston, not sure that would work. Any other ideas? Thank you. |
All times are GMT +1. The time now is 12:31 PM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com