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

Buttons are added multiple times in New Inspector window



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 5th 09, 02:45 PM posted to microsoft.public.outlook.program_addins
KarthikonIT via OfficeKB.com
external usenet poster
 
Posts: 14
Default Buttons are added multiple times in New Inspector window

Hi,
I m Creating a Plugin for MS OUtlook, I a few questions

I have added Button to New email window(ie. the window that is opened when an
email is double clicked), but multiple times buttons are
added since "Active Event" of Inspector is called again & again.

How do I prevent multiple buttons from adding up in the "New email window"?

Note:
I have assigned unique tags to the command bar buttons so that event are not
fired multiple times.


Brief description of my architecut
I have a class called "INspector wrapper" which implements the "Outlook::
InspectorEvents"
for every new email a new Instance of this class will be created.


I have a class called "BtnWrapper" which implments the "Office::
_CommandBarButtonEvents"
for every button created a new Instance of this class will be created.


I m adding the button in the "Active" event of Inspector.

Thanks in Advance.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...ddins/200911/1

Ads
  #2  
Old November 5th 09, 02:51 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Buttons are added multiple times in New Inspector window

You can set a Boolean flag after you create your button UI the first time
and check that flag before trying to create the UI so you only do it once.

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


"KarthikonIT via OfficeKB.com" u54961@uwe wrote in message
news:9eaa0e08eaae5@uwe...
Hi,
I m Creating a Plugin for MS OUtlook, I a few questions

I have added Button to New email window(ie. the window that is opened when
an
email is double clicked), but multiple times buttons are
added since "Active Event" of Inspector is called again & again.

How do I prevent multiple buttons from adding up in the "New email
window"?

Note:
I have assigned unique tags to the command bar buttons so that event are
not
fired multiple times.


Brief description of my architecut
I have a class called "INspector wrapper" which implements the "Outlook::
InspectorEvents"
for every new email a new Instance of this class will be created.


I have a class called "BtnWrapper" which implments the "Office::
_CommandBarButtonEvents"
for every button created a new Instance of this class will be created.


I m adding the button in the "Active" event of Inspector.

Thanks in Advance.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...ddins/200911/1


  #3  
Old November 5th 09, 03:35 PM posted to microsoft.public.outlook.program_addins
Karthik
external usenet poster
 
Posts: 1
Default Buttons are added multiple times in New Inspector window


Hi Ken,
I have already tried that, it works some times, some times i don't see
Button added to that or Multiple buttons added.


I have declared a boolean variable as a member variable of "INspector
wrapper" class which is created for every Inspector window opened.

Anything else I could try for this..

Thanks for ur reply Ken.



On Nov 5, 7:51*pm, "Ken Slovak - [MVP - Outlook]"
wrote:
You can set a Boolean flag after you create your button UI the first time
and check that flag before trying to create the UI so you only do it once..

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

"KarthikonIT via OfficeKB.com" u54961@uwe wrote in messagenews:9eaa0e08eaae5@uwe...



Hi,
I m Creating a Plugin for MS OUtlook, I a few questions


I have added Button to New email window(ie. the window that is opened when
an
email is double clicked), but multiple times buttons are
added since "Active Event" of Inspector is called again & again.


How do I prevent multiple buttons from adding up in the "New email
window"?


Note:
I have assigned unique tags to the command bar buttons so that event are
not
fired multiple times.


Brief description of my architecut
I have a class called "INspector wrapper" which implements the "Outlook::
InspectorEvents"
for every new email a new Instance of this class will be created.


I have a class called "BtnWrapper" which implments the "Office::
_CommandBarButtonEvents"
for every button created a new Instance of this class will be created.


I m adding the button in the "Active" event of Inspector.


Thanks in Advance.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...dins/200911/1- Hide quoted text -


- Show quoted text -


  #4  
Old November 5th 09, 03:39 PM posted to microsoft.public.outlook.program_addins
KarthikonIT via OfficeKB.com
external usenet poster
 
Posts: 14
Default Buttons are added multiple times in New Inspector window

Hi,

I have already tried that it works some times, other times i don't see the
button itself or multiple button.

I created a bool variable as a member variable of "INspector wrapper" class
which is created for every New email widow opened.

Is there anything that I could try for this..

Thanks for the help.



Ken Slovak - [MVP - Outlook] wrote:
You can set a Boolean flag after you create your button UI the first time
and check that flag before trying to create the UI so you only do it once.

Hi,
I m Creating a Plugin for MS OUtlook, I a few questions

[quoted text clipped - 24 lines]

Thanks in Advance.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...ddins/200911/1

  #5  
Old November 6th 09, 06:38 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Buttons are added multiple times in New Inspector window

That should be all you need, I've never had a problem with that.

If you do need some sort of sanity check beyond that, use
CommandBar.FindControl() to see if the control exists already before
creating it again.

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


"KarthikonIT via OfficeKB.com" u54961@uwe wrote in message
news:9eaa852f57454@uwe...
Hi,

I have already tried that it works some times, other times i don't see the
button itself or multiple button.

I created a bool variable as a member variable of "INspector wrapper"
class
which is created for every New email widow opened.

Is there anything that I could try for this..

Thanks for the help.


 




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
inspector toolbar buttons get multiple events Saeed Add-ins for Outlook 3 September 28th 09 02:05 PM
Multiple Toolbars being added/Multiple Buttons being added to Mail Matt Add-ins for Outlook 5 May 12th 09 07:06 PM
Custom Image added to CommandBar Buttons Andrew Add-ins for Outlook 2 November 26th 08 02:26 PM
adding coomand bar buttons to inspector window Ram Add-ins for Outlook 4 May 26th 06 06:16 AM
how to add commandbarbutton to inspector window Ram Add-ins for Outlook 0 January 18th 06 03:18 PM


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