Buttons are added multiple times in New Inspector window

Status
Not open for further replies.
K

KarthikonIT

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

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.


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

"KarthikonIT " <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 architecutre:
> 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.

> >
> 200911
>
 
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, " - " <kenslo...@mvps.org
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..

> >

> http://www.slovaktech.com

> "KarthikonIT " <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 architecutre:
> > 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.

>
> > > >
> >200911/1-[/url]


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



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

"KarthikonIT " <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.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
T Multiple Toolbars being added/Multiple Buttons being added to Mail Outlook VBA and Custom Forms 5
M In Outlook Calendar remove the buttons: 'Today' and '<' (Back a day) and '>' (Forward a day) that are below the Ribbon and above the calendar display. Using Outlook 0
P Two main Outlook gripes: Voting buttons not working externally nor Focused Inbox Using Outlook 1
V Changing default date for task follow-up buttons Using Outlook 2
D Custom Form Accept and Reject Command buttons Outlook VBA and Custom Forms 2
I Ribbon buttons grayed-out in Outlook 2013 Using Outlook 2
F Stationery with Voting buttons Using Outlook 9
P VBA create mail with attachment and voting buttons Using Outlook 6
R Custom buttons for frequently sent to reciopients, OL 2010 Using Outlook 1
R Outlook 2007 QAT buttons not saving Using Outlook 2
A Trouble importing data to radio buttons Business Contact Manager 2010 (BCM) Using Outlook 2
H enable textboxes and buttons from received email Using Outlook 1
Commodore Back/Forward toolbar buttons with pull-down history? Using Outlook 5
T Textarea and Radio Buttons in Outlook Email Using Outlook 1
S Voting Buttons are Not Tracking Using Outlook 1
P Voting buttons not showing Outlook VBA and Custom Forms 1
D Re: How do i insert radio buttons in an email Outlook VBA and Custom Forms 1
S Catch events from pre-existing buttons in Outlook 2007 Outlook VBA and Custom Forms 7
S HELP: Add logic to what Voting buttons do Outlook VBA and Custom Forms 1
S How to Create Buttons in email body / toolbar Outlook VBA and Custom Forms 3
S HELP: Create Buttons in Outlook Email body or Tool bar Outlook VBA and Custom Forms 1
S inspector toolbar buttons get multiple events Outlook VBA and Custom Forms 3
G Custom Buttons Disappear Outlook VBA and Custom Forms 1
M Radio buttons and checkboxes Outlook VBA and Custom Forms 2
S design buttons in email body Outlook VBA and Custom Forms 1
F Possible to restore/reinstall "special" buttons on custom form? Outlook VBA and Custom Forms 1
Nufc1980 Outlook "Please treat this as private label" auto added to some emails - Help. Using Outlook 4
E Edit incoming emails to remove a certain sentence added by the "system" Using Outlook 1
P Sending email from outlook IMAP to GMAIL where embedded images are added as attachment Using Outlook 1
T Junk Email does not get added to the Blocked Sender List Using Outlook 0
Horsepower Contacts added from iPhone don't show up in Outlook Using Outlook 2
F Junk Email does not get added to the Blocked Sender List Using Outlook 4
M Outlook 2013 Script Assistance - Save Opened Link with Subject Added Outlook VBA and Custom Forms 1
S newly added shared mailboxes downloading 500GB data a day Exchange Server Administration 1
O Adding a new account - "CompanyL (none)" line is added Using Outlook 5
A added new calendar, now not syncing to windows phone Using Outlook 3
M Multiple User Defined Fields that can be added, changed, updated using VBA and user form Outlook VBA and Custom Forms 0
R 2 email accounts, only 1 gets signatures added on new email. Using Outlook 1
Kristine RS box added in Favorites disappears Using Outlook 6
J DisablePST = 2 : Only Sharing-Exclusive PSTs can be added Using Outlook 1
P Outlook 2013 client not showing newly added Contacts but... Using Outlook 5
S Check if two organisition is added then i have to give managers passward creteria to send mail Using Outlook 1
S Newly added user doesn't show up in GAL but available in OWA, Using Outlook 0
O BCM 13 added leads to an outlook 13 contact subfolder BCM (Business Contact Manager) 1
Commodore Suggested Contacts by last added Using Outlook 1
S Trying to have a prompt to ask for text to be added to subject before sending. Using Outlook 3
H Automatic excel data added to Certain Emails that are received Using Outlook 3
O "Int-" prefix added to sender's address Using Outlook 4
K External Mtg Invitees have =SMTP: added to email address after mtg saved Using Outlook 5
C extra characters added to email when exporting Using Outlook 2

Similar threads

Back
Top