Event Handler for Folder Selected

R

roger

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

roger

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

Ken Slovak - [MVP - Outlook]

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

roger

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

Ken Slovak - [MVP - Outlook]

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

roger

The return from the button.Enabled = true is true and button.Enabled =
false is false;

I will try using FindControl instead.
 
K

Ken Slovak - [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top