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

How to add a user defined field to Redemption RDOContactItem object?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 9th 08, 02:53 AM posted to microsoft.public.outlook.program_addins
CataGeek
external usenet poster
 
Posts: 2
Default How to add a user defined field to Redemption RDOContactItem object?

Hi there. I've changed my code that talks to Outlook to use the
Redemption RDO objects instead. When I create a new contact I need to
define some user defined fields for each contact. Using the Outlook
objects I could do this:

Dim oUP As Outlook.UserProperty
Dim oContact As Outlook.ContactItem

With oContact
' set values for standard properties
' Now add my user defined fields
oUP = .UserProperties.Add("Area",
Outlook.OlUserPropertyType.olText)
oUP.Value =
dtRow.Item(objContact.GetOrdinalCustom("Area")).To String
oUP = .UserProperties.Add("Company - Yes/No",
Outlook.OlUserPropertyType.olText)
oUP.Value = dtRow.Item(objContact.GetOrdinalCustom("CompanyY/N"))

.Save
End With

Changing my code to use the Redemption.RDOContactItem object, I no
longer get access to the UserProperties collection. I've googled much
and so far haven't found a way to do this. Can anyone help me out
with this?
Ads
  #2  
Old July 9th 08, 02:45 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to add a user defined field to Redemption RDOContactItem object?

If you want to add actual UserProperties use the Outlook object model for
that. After the properties are added to the items you can then use RDO.

If you then want to access the UserProperties from RDO you can do so using
the Fields collection of the item and using the UserProperty name with
PS_PUBLIC_STRINGS and the type of UserProperty.

For example:

Const PS_PUBLIC_STRINGS = "{00062008-0000-0000-C000-000000000046}"
Const PT_LONG = &H3 ' example using a Long property (32 bit signed
integer)
Const PROP_NAME = "MyUserProperty"

' the RDO item is rdoItem

Dim tag As Long

tag = rdoItem.GetIDsFromNames(PS_PUBLIC_STRINGS, PROP_NAME)
tag = tag Or PT_LONG

You can then use tag with the Fields collection to access your UserProperty.

All UserProperties are created in the PS_PUBLIC_STRINGS namespace. However
the UserProperties collection also sets other properties in the folder when
a UserProperty is created, so using RDO to create a property in
PS_PUBLIC_STRINGS isn't enough to make that property a UserProperty for
Outlook.

--
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


"CataGeek" wrote in message
...
Hi there. I've changed my code that talks to Outlook to use the
Redemption RDO objects instead. When I create a new contact I need to
define some user defined fields for each contact. Using the Outlook
objects I could do this:

Dim oUP As Outlook.UserProperty
Dim oContact As Outlook.ContactItem

With oContact
' set values for standard properties
' Now add my user defined fields
oUP = .UserProperties.Add("Area",
Outlook.OlUserPropertyType.olText)
oUP.Value =
dtRow.Item(objContact.GetOrdinalCustom("Area")).To String
oUP = .UserProperties.Add("Company - Yes/No",
Outlook.OlUserPropertyType.olText)
oUP.Value = dtRow.Item(objContact.GetOrdinalCustom("CompanyY/N"))

.Save
End With

Changing my code to use the Redemption.RDOContactItem object, I no
longer get access to the UserProperties collection. I've googled much
and so far haven't found a way to do this. Can anyone help me out
with this?


  #3  
Old July 9th 08, 10:29 PM posted to microsoft.public.outlook.program_addins
CataGeek
external usenet poster
 
Posts: 2
Default How to add a user defined field to Redemption RDOContactItemobject?

On Jul 10, 1:45*am, "Ken Slovak - [MVP - Outlook]"
wrote:
If you want to add actual UserProperties use the Outlook object model for
that. After the properties are added to the items you can then use RDO.

If you then want to access the UserProperties from RDO you can do so using
the Fields collection of the item and using the UserProperty name with
PS_PUBLIC_STRINGS and the type of UserProperty.

For example:

Const PS_PUBLIC_STRINGS = "{00062008-0000-0000-C000-000000000046}"
Const PT_LONG = &H3 * *' example using a Long property (32 bit signed
integer)
Const PROP_NAME = "MyUserProperty"

' the RDO item is rdoItem

Dim tag As Long

tag = rdoItem.GetIDsFromNames(PS_PUBLIC_STRINGS, PROP_NAME)
tag = tag Or PT_LONG

You can then use tag with the Fields collection to access your UserProperty.

All UserProperties are created in the PS_PUBLIC_STRINGS namespace. However
the UserProperties collection also sets other properties in the folder when
a UserProperty is created, so using RDO to create a property in
PS_PUBLIC_STRINGS isn't enough to make that property a UserProperty for
Outlook.

--
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

"CataGeek" wrote in message

...

Hi there. I've changed my code that talks to Outlook to use the
Redemption RDO objects instead. *When I create a new contact I need to
define some user defined fields for each contact. *Using the Outlook
objects I could do this:


Dim oUP As Outlook.UserProperty
Dim oContact As Outlook.ContactItem


With oContact
* ' set values for standard properties
* ' Now add my user defined fields
* *oUP = .UserProperties.Add("Area",
Outlook.OlUserPropertyType.olText)
* *oUP.Value =
dtRow.Item(objContact.GetOrdinalCustom("Area")).To String
* *oUP = .UserProperties.Add("Company - Yes/No",
Outlook.OlUserPropertyType.olText)
* *oUP.Value = dtRow.Item(objContact.GetOrdinalCustom("CompanyY/N"))


* *.Save
End With


Changing my code to use the Redemption.RDOContactItem object, I no
longer get access to the UserProperties collection. *I've googled much
and so far haven't found a way to do this. *Can anyone help me out
with this?


Thanks for that Ken. I've been coming to the conclusion that I have to
use the Outlook objects rather than redemption to do this, and it's
great to get such a clear explaination. Much appreciated!
  #4  
Old July 10th 08, 12:09 AM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default How to add a user defined field to Redemption RDOContactItem object?

Next version of Redemption (4.6) will expose UserProperties collection on
all RDO items.
Keep in mind that a user property is nothing but a named property
(accessible through RDOMail.Fields[]), but Outlook alos expects user
property definition in yet another named property blob. UserProperties reads
and updates that blob.
Contact me at my private e-mail address if you want a beta version.
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"CataGeek" wrote in message
...
On Jul 10, 1:45 am, "Ken Slovak - [MVP - Outlook]"
wrote:
If you want to add actual UserProperties use the Outlook object model for
that. After the properties are added to the items you can then use RDO.

If you then want to access the UserProperties from RDO you can do so using
the Fields collection of the item and using the UserProperty name with
PS_PUBLIC_STRINGS and the type of UserProperty.

For example:

Const PS_PUBLIC_STRINGS = "{00062008-0000-0000-C000-000000000046}"
Const PT_LONG = &H3 ' example using a Long property (32 bit signed
integer)
Const PROP_NAME = "MyUserProperty"

' the RDO item is rdoItem

Dim tag As Long

tag = rdoItem.GetIDsFromNames(PS_PUBLIC_STRINGS, PROP_NAME)
tag = tag Or PT_LONG

You can then use tag with the Fields collection to access your
UserProperty.

All UserProperties are created in the PS_PUBLIC_STRINGS namespace. However
the UserProperties collection also sets other properties in the folder
when
a UserProperty is created, so using RDO to create a property in
PS_PUBLIC_STRINGS isn't enough to make that property a UserProperty for
Outlook.

--
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

"CataGeek" wrote in message

...

Hi there. I've changed my code that talks to Outlook to use the
Redemption RDO objects instead. When I create a new contact I need to
define some user defined fields for each contact. Using the Outlook
objects I could do this:


Dim oUP As Outlook.UserProperty
Dim oContact As Outlook.ContactItem


With oContact
' set values for standard properties
' Now add my user defined fields
oUP = .UserProperties.Add("Area",
Outlook.OlUserPropertyType.olText)
oUP.Value =
dtRow.Item(objContact.GetOrdinalCustom("Area")).To String
oUP = .UserProperties.Add("Company - Yes/No",
Outlook.OlUserPropertyType.olText)
oUP.Value = dtRow.Item(objContact.GetOrdinalCustom("CompanyY/N"))


.Save
End With


Changing my code to use the Redemption.RDOContactItem object, I no
longer get access to the UserProperties collection. I've googled much
and so far haven't found a way to do this. Can anyone help me out
with this?


Thanks for that Ken. I've been coming to the conclusion that I have to
use the Outlook objects rather than redemption to do this, and it's
great to get such a clear explaination. Much appreciated!


 




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
How do I add the same User-Defined Field for ALL Contacts? Mike Outlook - Using Contacts 1 September 5th 07 11:14 PM
Exporting a User-Defined Field JoeC Outlook - Using Forms 2 September 4th 07 01:38 PM
Using C# to create a user-defined field? Mikael Add-ins for Outlook 3 March 23rd 07 07:17 PM
Filtering On User Defined Field Alan Outlook - General Queries 1 January 18th 07 09:17 PM
User Defined Field Initial Value Matt Outlook and VBA 1 May 6th 06 06:54 AM


All times are GMT +1. The time now is 03:38 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.