I have some code that functions fine unless Outlook has the iManage add-in installed and uses the add-in's "File & Send" functionality.
The code does the following:
- Detect a new email draft
- Check if email draft has
myCustomGuid
property - If it doesn't, add the
myCustomGuid
to the email draft - If
myCustomGuid
is empty, generate a new Guid and add it to themyCustomGuid
property - Check if the email draft has an
EntryID
- If it doesn't, do nothing**
- If it does, use
MailItem.Save()
to persist themyCustomGuid
property/value.
This works fine when one sends a normal email.
However if:
- The draft has
myCustomGuid
property/value - The user selects the iManage 'File & Send' option
- The user clicks send
The myCustomGuid
value is blown away and I end up inserting a new one.
Any ideas on how/why iManage is blowing away the custom property? And/or how to keep it from doing so?
One other interesting tidbit. myCustomGuid
is not overwritten if the user does the following steps:
- The draft has
myCustomGuid
property/value - The user clicks send
- The user is prompted whether they also want to File the item when sending (by iManage)
- The user selects the iManage 'File & Send' option
** This means it hasn't been saved by the user or Outlook's auto-save functionality. So I don't want to persist it as that will create (potentially) an unwanted draft in the drafts folder. Thus why I do nothing.
First of all, your questions are related to the iManage add-in, so it makes sense to contact iManage developers to get any explanations. This is not the first issue I've met on my way when dealing with iManage add-ins in Outlook.
It seems iManage removes all user properties before sending an email to make sure no winmail.dat files will be attached. Both Microsoft Outlook and the Microsoft Exchange Client sometimes use a special method to package information for sending messages across the Internet. This method is technically known as Transport Neutral Encapsulation Format (TNEF). Read more about that in the How email message formats affect Internet email messages in Outlook article.
So, to avoid any unwanted attachments they strip out user properties from the mail items. There is no way to avoid that, you need to be sure the property is added, if not, you need to re-add it anew after iManage did its checks.