![]() |
UserProperties of MailItem object.
I am adding one user property to an email in outlook 2007 using VSTO Addin.
When I close Outlook application It asks me, "Do you want to save changes?". Can I avoid this prompt? API I used : prop = MailItem.UserProperties.Add("TestProp" , Outlook.OlUserPropertyType.olText , false , Outlook.OlFormatText.olFormatTextText); prop.Value = "Test"; |
UserProperties of MailItem object.
Sure, save the item using code.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Sandeep K" Sandeep wrote in message ... I am adding one user property to an email in outlook 2007 using VSTO Addin. When I close Outlook application It asks me, "Do you want to save changes?". Can I avoid this prompt? API I used : prop = MailItem.UserProperties.Add("TestProp" , Outlook.OlUserPropertyType.olText , false , Outlook.OlFormatText.olFormatTextText); prop.Value = "Test"; |
UserProperties of MailItem object.
Just a side note. I'm relatively new to Outlook programming but I got
into quite some trouble because of accessing the UserProperties directly. I would write: UserProperties props = MailItem.UserProperties; try { //Use props... //... MailItem.Save(); } finally { Marshall.ReleaseCOMObject(props); Marshall.ReleaseCOMObject(MailItem); } On 17 Aug., 16:47, Sandeep K Sandeep wrote: I am adding one user property to an email in outlook 2007 using VSTO Addin. |
UserProperties of MailItem object.
What problems did you have with your code?
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Tobias Böhm" wrote in message ... Just a side note. I'm relatively new to Outlook programming but I got into quite some trouble because of accessing the UserProperties directly. I would write: UserProperties props = MailItem.UserProperties; try { //Use props... //... MailItem.Save(); } finally { Marshall.ReleaseCOMObject(props); Marshall.ReleaseCOMObject(MailItem); } |
All times are GMT +1. The time now is 12:31 PM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com