![]() |
|
Create and Get user-defined fields in folder
Hi,
I have a COM add-in created using VB6. I need to create user-defined fields in one of the contact folder and get the user-defined fields value for usage later. Does anyone know how to create user-defined fields on contact folder and retrieve the created user-defined fields value? Thanks! ck |
Create and Get user-defined fields in folder
Do you want the properties on the folder object itself or on items in the
folder? Folder properties would have to be created using something like Extended MAPI or Redemption or CDO 1.21. For user properties on items just add the user property to an item and set the add to folder fields argument. -- 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 "ck" wrote in message ... Hi, I have a COM add-in created using VB6. I need to create user-defined fields in one of the contact folder and get the user-defined fields value for usage later. Does anyone know how to create user-defined fields on contact folder and retrieve the created user-defined fields value? Thanks! ck |
Create and Get user-defined fields in folder
Hi Ken,
Thanks for the reply. i need to add and get the properties in the folder object. Actually i do manage to add properties to folder object using this piece of code: Set objContact = objNewFolder.Items.Add(olContactItem) Set OlUserProperty = objContact.UserProperties.Add("GroupID", olNumber) objContact.Save BUT by doing this, i will need to add the contact item to the folder. I just want the properties to be in folder object. So, how to achieve this using Redemption or CDO 1.21? Any website/sample that i can go through? "Ken Slovak - [MVP - Outlook]" wrote: Do you want the properties on the folder object itself or on items in the folder? Folder properties would have to be created using something like Extended MAPI or Redemption or CDO 1.21. For user properties on items just add the user property to an item and set the add to folder fields argument. -- 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 "ck" wrote in message ... Hi, I have a COM add-in created using VB6. I need to create user-defined fields in one of the contact folder and get the user-defined fields value for usage later. Does anyone know how to create user-defined fields on contact folder and retrieve the created user-defined fields value? Thanks! ck |
Create and Get user-defined fields in folder
Hi Ken,
Thanks for the reply. i need to add and get the properties in the folder object. Actually i do manage to add properties to folder object using this piece of code: Set objContact = objNewFolder.Items.Add(olContactItem) Set OlUserProperty = objContact.UserProperties.Add("GroupID", olNumber) objContact.Save BUT by doing this, i will need to add the contact item to the folder. I just want the properties to be in folder object. So, how to achieve this using Redemption or CDO 1.21? Any website/sample that i can go through? "Ken Slovak - [MVP - Outlook]" wrote: Do you want the properties on the folder object itself or on items in the folder? Folder properties would have to be created using something like Extended MAPI or Redemption or CDO 1.21. For user properties on items just add the user property to an item and set the add to folder fields argument. -- 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 "ck" wrote in message ... Hi, I have a COM add-in created using VB6. I need to create user-defined fields in one of the contact folder and get the user-defined fields value for usage later. Does anyone know how to create user-defined fields on contact folder and retrieve the created user-defined fields value? Thanks! ck |
Create and Get user-defined fields in folder
Hi Ken, Thanks for the reply. i need to add and get the properties in the folder object. Actually i do manage to add properties to folder object using this piece of code: Set objContact = objNewFolder.Items.Add(olContactItem) Set OlUserProperty = objContact.UserProperties.Add("GroupID", olNumber) objContact.Save BUT by doing this, i will need to add the contact item to the folder. I just want the properties to be in folder object. So, how to achieve this using Redemption or CDO 1.21? Any website/sample that i can go through? "Ken Slovak - [MVP - Outlook]" wrote: Do you want the properties on the folder object itself or on items in the folder? Folder properties would have to be created using something like Extended MAPI or Redemption or CDO 1.21. For user properties on items just add the user property to an item and set the add to folder fields argument. -- 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 "ck" wrote in message ... Hi, I have a COM add-in created using VB6. I need to create user-defined fields in one of the contact folder and get the user-defined fields value for usage later. Does anyone know how to create user-defined fields on contact folder and retrieve the created user-defined fields value? Thanks! ck |
Create and Get user-defined fields in folder
You don't need to save the item. It is enough that you created it in the folder and added a property to it. Just call Set objContact = Nothing when you're done with it.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "ck" wrote in message ... Hi Ken, Thanks for the reply. i need to add and get the properties in the folder object. Actually i do manage to add properties to folder object using this piece of code: Set objContact = objNewFolder.Items.Add(olContactItem) Set OlUserProperty = objContact.UserProperties.Add("GroupID", olNumber) objContact.Save BUT by doing this, i will need to add the contact item to the folder. I just want the properties to be in folder object. So, how to achieve this using Redemption or CDO 1.21? Any website/sample that i can go through? "Ken Slovak - [MVP - Outlook]" wrote: Do you want the properties on the folder object itself or on items in the folder? Folder properties would have to be created using something like Extended MAPI or Redemption or CDO 1.21. For user properties on items just add the user property to an item and set the add to folder fields argument. "ck" wrote in message ... Hi, I have a COM add-in created using VB6. I need to create user-defined fields in one of the contact folder and get the user-defined fields value for usage later. Does anyone know how to create user-defined fields on contact folder and retrieve the created user-defined fields value? Thanks! ck |
Create and Get user-defined fields in folder
Sue,
Thanks. The property is created in the folder. How to get the property value? "Sue Mosher [MVP-Outlook]" wrote: You don't need to save the item. It is enough that you created it in the folder and added a property to it. Just call Set objContact = Nothing when you're done with it. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "ck" wrote in message ... Hi Ken, Thanks for the reply. i need to add and get the properties in the folder object. Actually i do manage to add properties to folder object using this piece of code: Set objContact = objNewFolder.Items.Add(olContactItem) Set OlUserProperty = objContact.UserProperties.Add("GroupID", olNumber) objContact.Save BUT by doing this, i will need to add the contact item to the folder. I just want the properties to be in folder object. So, how to achieve this using Redemption or CDO 1.21? Any website/sample that i can go through? "Ken Slovak - [MVP - Outlook]" wrote: Do you want the properties on the folder object itself or on items in the folder? Folder properties would have to be created using something like Extended MAPI or Redemption or CDO 1.21. For user properties on items just add the user property to an item and set the add to folder fields argument. "ck" wrote in message ... Hi, I have a COM add-in created using VB6. I need to create user-defined fields in one of the contact folder and get the user-defined fields value for usage later. Does anyone know how to create user-defined fields on contact folder and retrieve the created user-defined fields value? Thanks! ck |
Create and Get user-defined fields in folder
objContact.UserProperties("GroupID").Value would return the value of the GroupID property on any item to which that property has been added.
However, just because a property is defined in a folder doesn't mean that it exists yet on individual items or, by extension, has any values on those items. The property must be added to each item before a value can be set for it. The property is added automatically if the user assigns the property a value manually through in-cell editing or the All Fields page. Programmatically, your code would need to add the property to the item, then set its value before saving the item. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "ck" wrote in message ... Sue, Thanks. The property is created in the folder. How to get the property value? "Sue Mosher [MVP-Outlook]" wrote: You don't need to save the item. It is enough that you created it in the folder and added a property to it. Just call Set objContact = Nothing when you're done with it. "ck" wrote in message ... Hi Ken, Thanks for the reply. i need to add and get the properties in the folder object. Actually i do manage to add properties to folder object using this piece of code: Set objContact = objNewFolder.Items.Add(olContactItem) Set OlUserProperty = objContact.UserProperties.Add("GroupID", olNumber) objContact.Save BUT by doing this, i will need to add the contact item to the folder. I just want the properties to be in folder object. So, how to achieve this using Redemption or CDO 1.21? Any website/sample that i can go through? "Ken Slovak - [MVP - Outlook]" wrote: Do you want the properties on the folder object itself or on items in the folder? Folder properties would have to be created using something like Extended MAPI or Redemption or CDO 1.21. For user properties on items just add the user property to an item and set the add to folder fields argument. "ck" wrote in message ... Hi, I have a COM add-in created using VB6. I need to create user-defined fields in one of the contact folder and get the user-defined fields value for usage later. Does anyone know how to create user-defined fields on contact folder and retrieve the created user-defined fields value? |
Create and Get user-defined fields in folder
No wonder i can't get any value from the property in folder. If i need to
assign the property to item before i can assign any value to the property, property in item and folder are essentially the same. Then what is the different between property on folder level and property on item level? Sorry for all the annoying questions, i am still new to programming in Outlook. "Sue Mosher [MVP-Outlook]" wrote: objContact.UserProperties("GroupID").Value would return the value of the GroupID property on any item to which that property has been added. However, just because a property is defined in a folder doesn't mean that it exists yet on individual items or, by extension, has any values on those items. The property must be added to each item before a value can be set for it. The property is added automatically if the user assigns the property a value manually through in-cell editing or the All Fields page. Programmatically, your code would need to add the property to the item, then set its value before saving the item. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "ck" wrote in message ... Sue, Thanks. The property is created in the folder. How to get the property value? "Sue Mosher [MVP-Outlook]" wrote: You don't need to save the item. It is enough that you created it in the folder and added a property to it. Just call Set objContact = Nothing when you're done with it. "ck" wrote in message ... Hi Ken, Thanks for the reply. i need to add and get the properties in the folder object. Actually i do manage to add properties to folder object using this piece of code: Set objContact = objNewFolder.Items.Add(olContactItem) Set OlUserProperty = objContact.UserProperties.Add("GroupID", olNumber) objContact.Save BUT by doing this, i will need to add the contact item to the folder. I just want the properties to be in folder object. So, how to achieve this using Redemption or CDO 1.21? Any website/sample that i can go through? "Ken Slovak - [MVP - Outlook]" wrote: Do you want the properties on the folder object itself or on items in the folder? Folder properties would have to be created using something like Extended MAPI or Redemption or CDO 1.21. For user properties on items just add the user property to an item and set the add to folder fields argument. "ck" wrote in message ... Hi, I have a COM add-in created using VB6. I need to create user-defined fields in one of the contact folder and get the user-defined fields value for usage later. Does anyone know how to create user-defined fields on contact folder and retrieve the created user-defined fields value? |
Create and Get user-defined fields in folder
I think in almost all cases the store wouldn't let you create named
properties on a folder object. A user defined field in the folder is probably the best you can do. What would probably be a better alternative would be to create a hidden item in the folder to hold any value or values you want. You can't do that either with the Outlook object model (before Outlook 2007 where you can create a "StorageItem". But you can create hidden items in CDO using Folder.HiddenMessages.Add() and in Redemption using RDOFolder.HiddenItems.Add(). CDO information is at www.cdolive.com and Redemption information is at www.dimastr.com/redemption. -- 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 "ck" wrote in message ... Hi Ken, Thanks for the reply. i need to add and get the properties in the folder object. Actually i do manage to add properties to folder object using this piece of code: Set objContact = objNewFolder.Items.Add(olContactItem) Set OlUserProperty = objContact.UserProperties.Add("GroupID", olNumber) objContact.Save BUT by doing this, i will need to add the contact item to the folder. I just want the properties to be in folder object. So, how to achieve this using Redemption or CDO 1.21? Any website/sample that i can go through? "Ken Slovak - [MVP - Outlook]" wrote: Do you want the properties on the folder object itself or on items in the folder? Folder properties would have to be created using something like Extended MAPI or Redemption or CDO 1.21. For user properties on items just add the user property to an item and set the add to folder fields argument. -- 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 "ck" wrote in message ... Hi, I have a COM add-in created using VB6. I need to create user-defined fields in one of the contact folder and get the user-defined fields value for usage later. Does anyone know how to create user-defined fields on contact folder and retrieve the created user-defined fields value? Thanks! ck |
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