Enables/disabling actions takes effect 2nd open

  • Thread starter Thread starter klemid
  • Start date Start date
K

klemid

I'm running Outlook 2003 with custom forms. My form carries some script
coding which changes the Enable flag of an action in Item_Open based on
a customer property which is set during item creation. This changes
doesn't take effect the first time the item is opened. Using my trace
(Log4vb.com) shows that the code is processed. Although the action is
not executable ("That action is not available...") this is unfortunate.
When I close the form w/o saving it and re-open it that action is
enabled/disabled appropriately. Surprisingly the form is not a one-off
form and doesn't convert in a one-off form by changing the action's
enable flag. KB article 290657 states this to happen in Outlook 2002.
I'm wondering if there is a way to somehow refresh the commandbar
carrying the action.
- Klemens
 
I'd give it a try, using normal CommandBars methods (see http://www.outlookcode.com/d/tips/commandbarfun.htm. The custom action commandbar is the one named Response.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Hello Sue, thanks for the hint: I tried it and played around a lot with
disabling/enabling the Response bar and its buttons. Without success. I
recognized that it works when I adapt my UI in the Item_Read. But this
helps only the first time. The next time the item is opened the
Item_Read is not processed and the UI keeps unchanged. The only
workaround I see is to change the UI before the relevant changes are
stored instead of adapting it when the item is opened/read. Maybe this
works.
Regards,
Klemens
 
Why aren't you using Item_Open? That's the event that fires whenever the user opens the item in its own window.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
In Item_open the "oAction.Enabled = False" doesnt take effect. In
Item_Read it does. But I changed my mind and adapt the UI when the item
is saved rather than before it is displayed. This is not as clean in
terms of separation of Model and Controller but at least it works.
- Klemens
 
Unfortunately this solution is also not perfect because by changing the
UI and saving the item, the item become one-off. Therefore it becomes
much larger and my custom icon disappears.
- Klemens
 
What solution are you referring to? If you work with the Response toolbar, the actions on the item itself (which would be the source of the one-offing) shouldn't be modified.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top