Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   Event Handler for Folder Selected (http://www.outlookbanter.com/add-ins-outlook/15268-event-handler-folder-selected.html)

[email protected] May 20th 06 12:17 AM

Event Handler for Folder Selected
 
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.


[email protected] May 20th 06 01:16 AM

Event Handler for Folder Selected
 
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] May 21st 06 07:45 PM

Event Handler for Folder Selected
 
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.

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


wrote in message
ups.com...
Ok, I have an event handler working, but now I am trying to figure out
how to enable/disable toolbar buttons on the fly.



[email protected] May 24th 06 08:37 PM

Event Handler for Folder Selected
 

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] May 24th 06 09:00 PM

Event Handler for Folder Selected
 
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.

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


wrote in message
ps.com...

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.



[email protected] May 24th 06 11:19 PM

Event Handler for Folder Selected
 
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] May 24th 06 11:44 PM

Event Handler for Folder Selected
 
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.

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


wrote in message
ups.com...
The return from the button.Enabled = true is true and button.Enabled =
false is false;

I will try using FindControl instead.




All times are GMT +1. The time now is 09:58 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com