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 / May 2006

Tip: Looking for answers? Try searching our database.

Event Handler for Folder Selected

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
roger@rogndeb.us - 19 May 2006 23:17 GMT
I found event handlers for regular outlook items, but how do I insert
an event handler for other folders?

I have 2 buttons on a custom toolbar, and several application specific
folders. I need to enable or disable the toolbar buttons depending on
which folder the user selects.
roger@rogndeb.us - 20 May 2006 00:16 GMT
Ok, I have an event handler working, but now I am trying to figure out
how to enable/disable toolbar buttons on the fly.
Ken Slovak - [MVP - Outlook] - 21 May 2006 18:45 GMT
You would need a method to access the CommandBarButton objects that are your
buttons and set their Enabled property True or False as warranted by the
current state.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Ok, I have an event handler working, but now I am trying to figure out
> how to enable/disable toolbar buttons on the fly.
roger@rogndeb.us - 24 May 2006 19:37 GMT
I created access to the button objects when they are created.
They're not null, but when setting the Enabled property to true, the
buttons remain
grayed out.
Ken Slovak - [MVP - Outlook] - 24 May 2006 20:00 GMT
Are you getting a valid button object? Is the Enabled property returning an
error?

I've found that especially in WordMail that even if a button object is a
valid object that most of its properties and methods aren't valid even in
the button Click event handler. In those cases I have to actually
reinstantiate the button object using FindControl and then I can set
properties such as Picture and Mask and set visibility and enabled.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> I created access to the button objects when they are created.
> They're not null, but when setting the Enabled property to true, the
> buttons remain
> grayed out.
roger@rogndeb.us - 24 May 2006 22:19 GMT
The return from the button.Enabled = true is true and button.Enabled =
false is false;

I will try using FindControl instead.
Ken Slovak - [MVP - Outlook] - 24 May 2006 22:44 GMT
Sure it's the right button in the right Inspector or Explorer?

In my wrapper classes for Inspectors or Explorers I can set Enabled and
Visible true or false based on business logic conditions and it works.

The only time I have to re-instantiate the button objects are in WordMail
Inspectors.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> The return from the button.Enabled = true is true and button.Enabled =
> false is false;
>
> I will try using FindControl instead.
 
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



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