locked
max Length for userProperty Value. RRS feed

  • Question

  • I am creating a UserProperty, writing a string value to it and then addin it to OutlookMailItem.UserProperties in My Outlook Addin. Is there any maximum length for userProperty that I need to maintain?

    if(_mailItem.UserProperties[key]==null)
    {
    _mailItem.UserProperties.Add(key,Outlook.OlUserPropertyType.olText,null,null)
    }
    _mailItem.UserProperties[key].Value = myValue;
    _mailItem.Save()
    Friday, August 21, 2009 8:05 AM

Answers

  • Hi Kapilg,

    It depends on the type of new user property you want to add. According to your code, the type is Outlook.OlUserPropertyType.olText. olText represents a String property type, and corresponds to the MAPI type PT_STRING8[see: OlUserPropertyType Enumeration].  PT_STRING8 is also a LPSTR data type[see: MAPI Property Data Types], which specifies a pointer to an array of 8-bit characters, and is equal to Char*[see: LPSTR]. So if the type is olText, there is no length limit of new property value.

    Best regards,
    Bessie


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Kapilg Thursday, August 27, 2009 2:33 PM
    Thursday, August 27, 2009 4:41 AM

All replies

  • What length do you feel you are going over?

    William Wegerson (www.OmegaCoder.Com)
    Monday, August 24, 2009 6:48 PM
  • 4000- 5000 character
    Tuesday, August 25, 2009 11:11 AM
  • Hi Kapilg,

    It depends on the type of new user property you want to add. According to your code, the type is Outlook.OlUserPropertyType.olText. olText represents a String property type, and corresponds to the MAPI type PT_STRING8[see: OlUserPropertyType Enumeration].  PT_STRING8 is also a LPSTR data type[see: MAPI Property Data Types], which specifies a pointer to an array of 8-bit characters, and is equal to Char*[see: LPSTR]. So if the type is olText, there is no length limit of new property value.

    Best regards,
    Bessie


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Kapilg Thursday, August 27, 2009 2:33 PM
    Thursday, August 27, 2009 4:41 AM