Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / October 2009

Tip: Looking for answers? Try searching our database.

OnButtonClick event in MSOutlook called twice.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KarthikonIT - 27 Oct 2009 13:49 GMT
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.
Sue Mosher [MVP] - 28 Oct 2009 19:36 GMT
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
Signature

Sue Mosher, Outlook MVP
  Author of Microsoft Outlook 2007 Programming:
    Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

> Hi,
> I m Creating a Plugin for MS OUtlook, I a few questions
[quoted text clipped - 29 lines]
>
> Thanks in Advance.
KarthikonIT - 30 Oct 2009 14:31 GMT
Hi Sue,
Thanks a lot!!!
It makes office programming a lot easier..

>Set the CommandBarButton.Tag property to a unique string for each *instance*
>of the button.
[quoted text clipped - 6 lines]
>>
>> Thanks in Advance.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.