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

Customize Toolbar Appear Multiple Times



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 28th 07, 03:13 PM posted to microsoft.public.outlook.program_addins
pjerling
external usenet poster
 
Posts: 12
Default Customize Toolbar Appear Multiple Times

Hi there,

I have created a new toolbar in Outlook 2003 using C#. Everytime I open a
message, the toolbar appears again. Thus if I have 1 email open i'll see the
toolbar. If I open another email, I'll see two toolbars, etc...

How do I check to see whether the toolbar already exists and if it does
exists do not create it again.

Thanks.
PJ
Ads
  #2  
Old September 28th 07, 03:47 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Customize Toolbar Appear Multiple Times

Your best approach is to use an Inspector wrapper class so you can handle
click events individually for each open Inspector in case there's more than
one Inspector open. See Helmut Obertanner's C# Inspector wrapper at
www.outlookcode.com for that.

Key points for the wrapper or other handling like that:

1. Use a unique Tag property for every toolbar you create so multiple open
items don't each get every Click event.

2. Create your UI using the Temporary argument and set it true so the UI is
automatically disposed of.

3. Delete the UI when the item is closed as a safety precaution and best
practice.


--
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


"pjerling" wrote in message
...
Hi there,

I have created a new toolbar in Outlook 2003 using C#. Everytime I open a
message, the toolbar appears again. Thus if I have 1 email open i'll see
the
toolbar. If I open another email, I'll see two toolbars, etc...

How do I check to see whether the toolbar already exists and if it does
exists do not create it again.

Thanks.
PJ


  #3  
Old September 28th 07, 04:34 PM posted to microsoft.public.outlook.program_addins
pjerling
external usenet poster
 
Posts: 12
Default Customize Toolbar Appear Multiple Times

Brilliant thanks Ken!

"Ken Slovak - [MVP - Outlook]" wrote:

Your best approach is to use an Inspector wrapper class so you can handle
click events individually for each open Inspector in case there's more than
one Inspector open. See Helmut Obertanner's C# Inspector wrapper at
www.outlookcode.com for that.

Key points for the wrapper or other handling like that:

1. Use a unique Tag property for every toolbar you create so multiple open
items don't each get every Click event.

2. Create your UI using the Temporary argument and set it true so the UI is
automatically disposed of.

3. Delete the UI when the item is closed as a safety precaution and best
practice.


--
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


"pjerling" wrote in message
...
Hi there,

I have created a new toolbar in Outlook 2003 using C#. Everytime I open a
message, the toolbar appears again. Thus if I have 1 email open i'll see
the
toolbar. If I open another email, I'll see two toolbars, etc...

How do I check to see whether the toolbar already exists and if it does
exists do not create it again.

Thanks.
PJ



 




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
message sent multiple times June Outlook Express 2 August 9th 07 11:36 PM
How to customize standard toolbar? [email protected] Outlook - General Queries 3 February 2nd 07 02:47 PM
Customize Toolbar Outlook 2003 Jack Clift Outlook - Installation 3 December 5th 06 05:44 AM
Customize Multiple calendars view Patrick de Vos Outlook - Calandaring 0 November 23rd 06 02:48 PM
Customize Toolbar corrupted IF Outlook - General Queries 8 April 4th 06 05:17 AM


All times are GMT +1. The time now is 09:25 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.