Help!

OnButtonClick event in MSOutlook called twice.

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Program Add-Ins RSS
Next:  MS Word (Vista) with corrupted template that isn'..  
Author Message
KarthikonIT via OfficeKB.
External


Since: Oct 27, 2009
Posts: 2



PostPosted: Tue Oct 27, 2009 9:10 am    Post subject: OnButtonClick event in MSOutlook called twice.
Archived from groups: microsoft>public>outlook>program_addins (more info?)

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

Q. I have added Button to New email window(ie. the window that
is opened when an email is double clicked)

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.

DispEventAdvise & DispEventUnadvise are added in the constructor and
destructor of "BtnWrapper"& "INspector wrapper" class for resp. events.



Instance of the "BtnWrapper" class will be created with "INspector wrapper"
class.

Now my problem is when 2 emails are double clicked and opened in new window.
"OnButtonClick" event is called twice.




Note:
when n mails are double clicked & opened. "OnButtonClick" triggered n times.
Buttons is added only once in the toolbar.



Any clue to resolve this.

Thanks in Advance.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/outlook-prog-addins/200910/1
Back to top
Sue Mosher [MVP]
External


Since: Oct 08, 2009
Posts: 7



PostPosted: Wed Oct 28, 2009 11:36 am    Post subject: RE: OnButtonClick event in MSOutlook called twice. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Set the CommandBarButton.Tag property to a unique string for each *instance*
of the button.

The same thing applies to Word, too; see
http://kevin-berridge.blogspot.com/2009/04/word-commandbarbutton-tag.html
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54



"KarthikonIT via OfficeKB.com" wrote:

> Hi,
> I m Creating a Plugin for MS OUtlook, I a few questions
>
> Q. I have added Button to New email window(ie. the window that
> is opened when an email is double clicked)
>
> 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.
>
> DispEventAdvise & DispEventUnadvise are added in the constructor and
> destructor of "BtnWrapper"& "INspector wrapper" class for resp. events.
>
>
>
> Instance of the "BtnWrapper" class will be created with "INspector wrapper"
> class.
>
> Now my problem is when 2 emails are double clicked and opened in new window.
> "OnButtonClick" event is called twice.
>
>
>
>
> Note:
> when n mails are double clicked & opened. "OnButtonClick" triggered n times.
> Buttons is added only once in the toolbar.
>
>
>
> Any clue to resolve this.
>
> Thanks in Advance.
>
> --
> Message posted via OfficeKB.com
> http://www.officekb.com/Uwe/Forums.aspx/outlook-prog-addins/200910/1
>
> .
>
Back to top
KarthikonIT via OfficeKB.
External


Since: Oct 27, 2009
Posts: 2



PostPosted: Fri Oct 30, 2009 10:10 am    Post subject: RE: OnButtonClick event in MSOutlook called twice. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Sue,
Thanks a lot!!!
It makes office programming a lot easier..



Sue Mosher [MVP] wrote:
>Set the CommandBarButton.Tag property to a unique string for each *instance*
>of the button.
>
>The same thing applies to Word, too; see
>http://kevin-berridge.blogspot.com/2009/04/word-commandbarbutton-tag.html
>> Hi,
>> I m Creating a Plugin for MS OUtlook, I a few questions
>[quoted text clipped - 29 lines]
>>
>> Thanks in Advance.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/outlook-prog-addins/200910/1
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Program Add-Ins All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum