A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

UserProperties of MailItem object.



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 17th 09, 03:47 PM posted to microsoft.public.outlook.program_addins
Sandeep K
external usenet poster
 
Posts: 3
Default 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";

Ads
  #2  
Old August 17th 09, 07:26 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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";


  #3  
Old August 19th 09, 11:03 AM posted to microsoft.public.outlook.program_addins
Tobias Böhm
external usenet poster
 
Posts: 13
Default 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.

  #4  
Old August 19th 09, 02:36 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default 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);
}

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
UserProperties and/or propertyaccessor on multiple access mailitem Christian Add-ins for Outlook 2 January 14th 08 03:22 PM
Problem with Object Reference for MailItem alexcraig Outlook and VBA 3 January 6th 08 10:08 PM
MailItem UserProperties in OWA (Outlook Web Access) [email protected] Outlook and VBA 5 April 23rd 07 11:18 AM
Discarding the changes of mailItem object after saving it to the d AtulSureka Outlook - Using Forms 6 January 17th 07 02:50 PM
MailItem.UserProperties property itself does not exist? (0x8004010F error) Jeff Outlook and VBA 2 October 17th 06 01:58 PM


All times are GMT +1. The time now is 08:57 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.