Override custom form code from Add-in

S

sublimese

Is there any way through any model or tool (Outlook Object Model,
Exchange Extension, Mapi, Redemption, etc...) to block the code on a
custom outlook form from running without changing the custom outlook
form itself. The code to do the blocking would be in an addin.

For example, I have a custom appointment form with the messageclass
IPM.Appointment.CustomTest1

IPM.Appointment.CustomTest1 has code that runs in the Item_Open event.

In my addin, when IPM.Appointment.CustomTest1 opens I do a variety of
checks. Depending on the results of the checks I want to block the
code that is in the Item_Open of IPM.Appointment.CustomTest1 from
running.

A similar situation exists for Item_Write.
IPM.Appointment.CustomTest1 also has code that runs for Item_Write.

In my addin, when IPM.Appointment.CustomTest1 opens, I hook the
Item_Write event, then when the Item_Write event of the addin is hit,
I can perform my logic, make any changes to the appointment I need to
make, save the appointment, then set the Cancel parameter to true,
which will effectively block the Item_Write on the custom form from
occurring. The issue with doing this is that if the user selected
"Save and Close" the form does not close.

For Item_Open I cannot set Cancel=true in the addin event because
doing so stops the item from opening at all.


Is if possible to block the code on a custom form from running without
altering the from itself?


Thank you
 
K

Ken Slovak - [MVP - Outlook]

Answered in one of the other groups you posted in. Please do not multipost.
 

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