Customize Toolbar Appear Multiple Times

G

Guest

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
 
K

Ken Slovak - [MVP - Outlook]

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

Guest

Brilliant thanks Ken!

Ken Slovak - said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top