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 / July 2009

Tip: Looking for answers? Try searching our database.

How to know New button is clicked

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nagaraj - 28 Jul 2009 09:35 GMT
Hi,

I have the following code in my app

if (this.Application.ActiveExplorer().Selection.Count > 0)
               {
                   Object selObject =
this.Application.ActiveExplorer().Selection[1];
                 
                   if (selObject is Outlook.MailItem)
                   {
                       Outlook.MailItem mailItem =
                            (selObject as Outlook.MailItem);
                     
                      XXXXXXXXXXXXXXXXXXXXXX

                  }
           }

At the place XXXXXXXXXXXXXXXXXXXXXX
I want to know whether New button on the standard toolbar is clicked or not.
I want to do some calculations if New button is clicked.
Can anyone show me how to this in C# outlook plugin code?

Thanks
Signature

Nagaraj Tadipatri

Ken Slovak - [MVP - Outlook] - 28 Jul 2009 14:17 GMT
When New is clicked a new item is opened, which would fire the
Inspectors.NewInspector() event. You need to subscribe to that event to know
when that button is clicked.

As an alternative you can also get that control as a CommandBarButton object
in the "Standard" CommandBar and subscribe to the control's Click() event.
In that case you know it was clicked but that's it. You don't get a handle
to whatever was created. So using both events may be what you need to do
depending on exactly what you want.

Signature

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

> Hi,
>
[quoted text clipped - 22 lines]
>
> Thanks
 
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.