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 » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Access MaiItem.UserProperties using Redemption



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 22nd 07, 05:00 AM posted to microsoft.public.outlook.program_vba
MA[_2_]
external usenet poster
 
Posts: 47
Default Access MaiItem.UserProperties using Redemption

Hi,

I am using the Redemption to create a message. I need to add the user
defined fields to the message.

I know the Outlook.MaiItem has the UserProperties which allow to add
field and optionally attach to the folder. However, UserProperties not
available in Redemption.

How can I access the UserProperties from the RDOMail?

--------------------------------------------
// Get the RDOFolder
session.MAPIOBJECT = olApp.Session.MAPIOBJECT;
RDOFolder rdoFolder = session.GetFolderFromPath(@"\\Bob Builder
\Inbox");

// Create the message
RDOMail msg = rdoFolder.Items.Add("IPM.Note.CRM");
msg.Sent = true;
msg.Subject = String.Format("Test sent message: {0}", DateTime.Now);
RDORecipient recipient = ");
recipient.Resolve(false, null);
msg.Sender = session.CurrentUser;
msg.SentOn = Convert.ToDateTime("2007/09/10",
System.Globalization.CultureInfo.CurrentCulture);
msg.Body = "Test message body";
msg.Save();
---------------------------------------------

Thanks for looking at the issue.

Regards,
MA
  #2  
Old November 22nd 07, 10:00 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Access MaiItem.UserProperties using Redemption

Set the properties using RDOMail.Fields - see
http://www.dimastr.com/redemption/rd...htm#properties

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"MA" wrote in message
...
Hi,

I am using the Redemption to create a message. I need to add the user
defined fields to the message.

I know the Outlook.MaiItem has the UserProperties which allow to add
field and optionally attach to the folder. However, UserProperties not
available in Redemption.

How can I access the UserProperties from the RDOMail?

--------------------------------------------
// Get the RDOFolder
session.MAPIOBJECT = olApp.Session.MAPIOBJECT;
RDOFolder rdoFolder = session.GetFolderFromPath(@"\\Bob Builder
\Inbox");

// Create the message
RDOMail msg = rdoFolder.Items.Add("IPM.Note.CRM");
msg.Sent = true;
msg.Subject = String.Format("Test sent message: {0}", DateTime.Now);
RDORecipient recipient = ");
recipient.Resolve(false, null);
msg.Sender = session.CurrentUser;
msg.SentOn = Convert.ToDateTime("2007/09/10",
System.Globalization.CultureInfo.CurrentCulture);
msg.Body = "Test message body";
msg.Save();
---------------------------------------------

Thanks for looking at the issue.

Regards,
MA



  #3  
Old November 23rd 07, 12:07 AM posted to microsoft.public.outlook.program_vba
MA[_2_]
external usenet poster
 
Posts: 47
Default Access MaiItem.UserProperties using Redemption

Thanks Dmitry for your answer.

The RDOMail does not seems to have the "Fields" property. I can see
the set_Fields, get_Fields, GetPropList, etc. Am I missing something
in here?

Thanks in advance for your suggestions.

Regards,
MA
  #4  
Old November 23rd 07, 08:02 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Access MaiItem.UserProperties using Redemption

set_Fields/get_Fields are the getter/setter for the Fields indexed property:

RDOMail.set_Fields("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/PropertyName",
"some new value");
RDOMail.Save;

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"MA" wrote in message
...
Thanks Dmitry for your answer.

The RDOMail does not seems to have the "Fields" property. I can see
the set_Fields, get_Fields, GetPropList, etc. Am I missing something
in here?

Thanks in advance for your suggestions.

Regards,
MA



  #5  
Old November 28th 07, 05:30 AM posted to microsoft.public.outlook.program_vba
MA[_2_]
external usenet poster
 
Posts: 47
Default Access MaiItem.UserProperties using Redemption

Thanks for your suggestions.

I have tried the following code which did not add the custom field.
-------------------------------------------------------
rdoMsg.set_Fields("http://schemas.microsoft.com/mapi/string/
{00063034-0000-0000-C000-000000000046}/UDF1", "test value");
rdoMsg.Save();
-------------------------------------------------------

However, I can add the custom field using the code below:

-------------------------------------------------------
rdoMsg.HTMLBody = "test STRONGmessage/STRONG body.";
rdoMsg.Save();

Outlook.MailItem olMsg =
(Outlook.MailItem)olNameSpace.GetItemFromID(rdoMsg .EntryID, "");
Outlook.UserProperty udf = olMsg.UserProperties.Add("UDF1",
Outlook.OlUserPropertyType.olText, false, false);
olMsg.UserProperties["UDF1"].Value = "Some value";
olMsg.Save();
-------------------------------------------------------

Am I missing something?

Thanks,
MA
  #6  
Old November 28th 07, 06:41 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Access MaiItem.UserProperties using Redemption

Where and when are you using the added user property? Can you see it in
OutlookSpy when you click IMessage?
The values of the user properties are stored as regular named MAPI
properties (that is what rdoMsg.set_Fields will do for you).
Outlook however (when you use MailItem.UserProperties.Add) also adds the
property *definition* to a special blob (you can also see it in OutlookSpy).
If the property defintiion is not added (Redemption does not do that),
MailItem.UserProperties collection won't see it even if the value is there.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"MA" wrote in message
...
Thanks for your suggestions.

I have tried the following code which did not add the custom field.
-------------------------------------------------------
rdoMsg.set_Fields("http://schemas.microsoft.com/mapi/string/
{00063034-0000-0000-C000-000000000046}/UDF1", "test value");
rdoMsg.Save();
-------------------------------------------------------

However, I can add the custom field using the code below:

-------------------------------------------------------
rdoMsg.HTMLBody = "test STRONGmessage/STRONG body.";
rdoMsg.Save();

Outlook.MailItem olMsg =
(Outlook.MailItem)olNameSpace.GetItemFromID(rdoMsg .EntryID, "");
Outlook.UserProperty udf = olMsg.UserProperties.Add("UDF1",
Outlook.OlUserPropertyType.olText, false, false);
olMsg.UserProperties["UDF1"].Value = "Some value";
olMsg.Save();
-------------------------------------------------------

Am I missing something?

Thanks,
MA



  #7  
Old November 23rd 07, 12:15 AM posted to microsoft.public.outlook.program_vba
MA[_2_]
external usenet poster
 
Posts: 47
Default Access MaiItem.UserProperties using Redemption

Basically, I want to add the add the fields to the message. I can do
this using the Outlook MailItem. I am not sure how to use it when
using the Redemption.RDOMail item. Should I need to access the Outlook
MailItem after I create the message using the RDOMail (see the source
code above).

Could you please provide some example.

Example below which uses the Outlook.MailItem:
quote
Outlook.MailItem msg = folder.Items.Add("IPM.Note") as MailItem;
msg.UserProperties.Add("Test Field",
Outlook.OlUserPropertyType.olText, true, "")
/quote


Thanks,
MA
 




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
More on UserProperties Steve Add-ins for Outlook 13 November 20th 07 11:12 PM
UserProperties Icon Anyone for Coffee? Add-ins for Outlook 2 May 1st 07 09:17 PM
MailItem UserProperties in OWA (Outlook Web Access) [email protected] Outlook and VBA 5 April 23rd 07 11:18 AM
UserProperties j Add-ins for Outlook 0 February 12th 07 07:06 AM
VB.net Cannot add userproperties Ben Add-ins for Outlook 2 February 24th 06 10:32 AM


All times are GMT +1. The time now is 03:40 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-2025 Outlook Banter.
The comments are property of their posters.