WriteEventHandler, Problem with Outlook 2003

Joined
Sep 8, 2009
Messages
4
Reaction score
0
- Outlook Addin for Outlook 2002 (xp), 2003 and 2007
- C# .NET, Extensibility, Shared Addin

Hi there
We wrote an add-in for Outlook 2002 (xp), 2003 and 2007 that (among other things) imports contacts from a database into outlook. To avoid later modification of these contacts by the user, I install an event handler that displays a message and sets Cancel to true, so the change is not saved:

ci.Write += new ItemEvents_10_WriteEventHandler(ci_Write);
...
void ci_Write(ref bool Cancel)
{
MessageBox.Show("Contacts cannot be modified.", "Modify", MessageBoxButtons.OK, MessageBoxIcon.Information);
Cancel = true;
((_Inspector)this.applicationObject.ActiveInspector()).Close(OlInspectorClose.olDiscard);
}


This works perfectly with Outlook 2002 and 2007 - message shows, contact stays the same. However, my testing with Outlook 2003 failed. When pressing the "Save" button on the contact after modification, the message does not appear (so, the function seems not to be called...), and the contact is not saved (which is correct). I notice it's only with Outlook 2003. I do the testing for different Outlook versions with virtual machines, so it could be a configuration issue on this machine also...

1. I also notice the function is called "ItemEvents_10_WriteEventHandler" - the 10 in its name being the outlook version?
2. Could it be I supply a wrong version of PIA on this Outlook 2002 virtual machine?
3. Any other ideas, what might cause this behaviour?

Any help would be greatly appreciated!
Regards,
StefanGebhard
 

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