A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Multiple Instances of Add-In Loading



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 23rd 08, 05:06 PM posted to microsoft.public.outlook.program_addins
Paulem0071
external usenet poster
 
Posts: 22
Default 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!
Ads
  #2  
Old October 24th 08, 04:27 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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!


  #3  
Old October 29th 08, 03:52 PM posted to microsoft.public.outlook.program_addins
Paulem0071
external usenet poster
 
Posts: 22
Default 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!



  #4  
Old October 29th 08, 06:42 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to prevent multiple instances of OE ? Mantra Outlook Express 10 March 9th 07 07:14 PM
Multiple Instances of Outlook John Mann Outlook and VBA 1 December 8th 06 06:09 PM
Closing Multiple Instances bobdydd Outlook - General Queries 3 May 22nd 06 01:56 AM
Multiple instances of Outlook DS-NTE Outlook - General Queries 1 February 22nd 06 12:51 PM
Multiple Instances. Mister Q Outlook - Installation 1 January 10th 06 11:59 PM


All times are GMT +1. The time now is 08:20 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.