![]() |
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. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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 |
Ads |
#2
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
#5
|
|||
|
|||
![]()
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 |
#6
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
#8
|
|||
|
|||
![]()
Thanks for the clarification.
It make sense now and I can see the property when I use the IMessage (Love the OutlookSpy). I need to locate the fields using the Outlook client. In this case, the fields need to be added to the folder definitions. The following code works fine. ----------------------------------------------------- Outlook.MailItem olMsg = (Outlook.MailItem)olNameSpace.GetItemFromID(rdoMsg .EntryID, ""); Outlook.UserProperty udf = olMsg.UserProperties.Add("UDF4", Outlook.OlUserPropertyType.olText, true, Outlook.OlUserPropertyType.olText); olMsg.UserProperties["UDF4"].Value = "Test value"; olMsg.Save(); ----------------------------------------------------- Any suggestions. Thanks, MA |
#9
|
|||
|
|||
![]()
You can add a field to folder fields (so it will be visible in the field
picker) without creating a message - use RDOFolder2.FolderFields: http://www.dimastr.com/redemption/rd...htm#rdofolder2 Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "MA" wrote in message ... Thanks for the clarification. It make sense now and I can see the property when I use the IMessage (Love the OutlookSpy). I need to locate the fields using the Outlook client. In this case, the fields need to be added to the folder definitions. The following code works fine. ----------------------------------------------------- Outlook.MailItem olMsg = (Outlook.MailItem)olNameSpace.GetItemFromID(rdoMsg .EntryID, ""); Outlook.UserProperty udf = olMsg.UserProperties.Add("UDF4", Outlook.OlUserPropertyType.olText, true, Outlook.OlUserPropertyType.olText); olMsg.UserProperties["UDF4"].Value = "Test value"; olMsg.Save(); ----------------------------------------------------- Any suggestions. Thanks, MA |
#10
|
|||
|
|||
![]()
Thanks.
I have tried the following code without any success. The RDOFolderField - "field" object return null. I have tried without GUID by passing null value. String.empty on Guid return exception. Any suggestions? ------------------------------------ RDOFolder2 rdoFolder2 = (RDOFolder2)rdoFolder; RDOFolderField field = rdoFolder2.FolderFields.Add("UDF2", Redemption.rdoUserPropertyType.olText, "{00020329-0000-0000- C000-000000000046}", 0); if (field != null) rdoFolder2.FolderFields.Save(); --------------------------------- Regards, MA |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |