How to add new property to email item in VBScript RRS feed

  • Question

  • How to add new property to email item in VBScript?

    The property name is "My_Property"


    Thursday, April 14, 2016 9:19 AM


  • Hello,

    You can use the UserProperties property of the MailItem class which returns the UserProperties collection that represents all the user properties for the Outlook item. Use the Add method to create a new UserProperty for an item and add it to the UserProperties object. The Addmethod allows you to specify a name and type for the new property. When you create a new property, it can also be added as a custom field to the folder that contains the item (using the same name as the property) by setting theAddToFolderFields parameter to True when calling the Add method. That field can then be used as a column in folder views.

    Set myProp = myItem.UserProperties.Add("My_Property", olText)

    To get or set multiple custom properties, use the PropertyAccessor object instead of the UserProperties object for better performance.


    Thursday, April 14, 2016 1:15 PM