Problem with custom form after drag and drop (security related?)

G

Guest

I've added a custom form to an appointment item. It collects some extra
information about the appointment from the user and stores it in a SQL
database (along with the appt times etc...).
It works fine. If the user drags and drops the meeting to a new time I want
to update my database. So I catch the item_Write event, I can tell when its a
drag/drop save because my form isn't loaded. I get an itemInspector and call
its Activate method to get my form code loaded. I pass a parameter to tell my
code its a dragdrop and my code saves the new times to the database. This all
works fine. However at the end of it all Outlook stops letting my custom
form load for that item if I try to open it again: I get the following error:

"ERROR: To help prevent malicious code from running, one or more objects in
this form were not loaded. For more information, contact your administrator."

Could it be that I need to close the item more tidily somehow?
 
G

Guest

AlanGlover said:
I've added a custom form to an appointment item. It collects some extra
information about the appointment from the user and stores it in a SQL
database (along with the appt times etc...).
It works fine. If the user drags and drops the meeting to a new time I want
to update my database. So I catch the item_Write event, I can tell when its a
drag/drop save because my form isn't loaded. I get an itemInspector and call
its Activate method to get my form code loaded. I pass a parameter to tell my
code its a dragdrop and my code saves the new times to the database. This all
works fine. However at the end of it all Outlook stops letting my custom
form load for that item if I try to open it again: I get the following error:

"ERROR: To help prevent malicious code from running, one or more objects in
this form were not loaded. For more information, contact your administrator."

Could it be that I need to close the item more tidily somehow?
 
G

Guest

I've discovered that the error is caused by my form being regarded as a "One
- off". This actually occurs when I add a userproperty to the item. You can
tell this has happened because the item.MessageClass changes from
"item.appointment.myform" to "item.appointmentItem". So you can't add
userproperties.

I still need to find a way to mark the item temporarily as having been
drag-dropped so my item_Open code can perform a different action from the
normal open. Any ideas how I can do this?
 

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