none
Display assigned email Retention Tag/Policy in Inbox default view in Outlook 2013 RRS feed

  • Question

  • Hi,

    I am trying to find the way to display assigned retention policy Tag/policy in the  Inbox default(Outlook 2013) view along with other fields such as Sender, Subject, Received etc. As far as I know, the retention is only displayed if you open an email(Inspector Window). I've read a little about PropertyAccessor, but I cannot see any examples of code to get (PR_POLICY_TAG, PR_RETENTION DATE) value (GUID) and how to translate the guid into the text. I expect it will involve coding and I am ok with coding or creating a add-in that will grab these values and customize the inbox folder view to display them, or at lease color code those that have one assigned. Basically users want easy way to figure out at a glance which email items has the retention policy/tag (other than default DPT) assigned without having to open each email to see it. 

    Any pointers, examples, articles?

    Thanks,

    Goran


    • Edited by goxy1 Thursday, August 7, 2014 6:22 PM
    Thursday, August 7, 2014 6:22 PM

Answers

  • Hello,

    You can read about the PropertyAccessor class in MSDN at http://msdn.microsoft.com/en-us/library/office/ff863046(v=office.15).aspx . There you can also find a sample code.

    The Add method of the ViewField class allows to add a property to the view. You can find a sample code and detailed explanation at http://msdn.microsoft.com/en-us/library/office/ff860939(v=office.15).aspx which states the following:

    To programmatically add a custom field to a view, use the ViewFields.Add method. This is the recommended way to dynamically change the view over setting the XML property of the View object.
    Referencing the property in PropertyName by its field name requires the localized name in the corresponding locale. For more information on referencing properties by namespace, see Referencing Properties by Namespace.
    If you are adding a custom property to the ViewFields collection, the property must exist in the UserDefinedProperties collection for the View’s parent folder.
    If the property already exists in the ViewFields collection, Outlook will raise an error. Certain properties cannot be added to a view using ViewFields.Add, including binary properties, computed properties, and HTML or RTF body content. For more information, see Unsupported Properties in a Table Object or Table Filter.

    Finally, you can read about property tags at http://msdn.microsoft.com/en-us/library/office/ff868915(v=office.15).aspx. But I'd recommend using outlook spy or any other utility for exploring properties and finding their IDs.

    P.S. It is quite hard to compose the answer on a tablet, so excuse me for a poor formatting of the message.
    Thursday, August 7, 2014 7:22 PM
  • Yes, if you are going to distribute the solution on multiple PCs.

    See the XML property of the View class and Programmatically Adding a Column to Your Outlook 2007 Inbox Table View article for more information.

    Thursday, August 7, 2014 9:00 PM

All replies

  • Hello,

    You can read about the PropertyAccessor class in MSDN at http://msdn.microsoft.com/en-us/library/office/ff863046(v=office.15).aspx . There you can also find a sample code.

    The Add method of the ViewField class allows to add a property to the view. You can find a sample code and detailed explanation at http://msdn.microsoft.com/en-us/library/office/ff860939(v=office.15).aspx which states the following:

    To programmatically add a custom field to a view, use the ViewFields.Add method. This is the recommended way to dynamically change the view over setting the XML property of the View object.
    Referencing the property in PropertyName by its field name requires the localized name in the corresponding locale. For more information on referencing properties by namespace, see Referencing Properties by Namespace.
    If you are adding a custom property to the ViewFields collection, the property must exist in the UserDefinedProperties collection for the View’s parent folder.
    If the property already exists in the ViewFields collection, Outlook will raise an error. Certain properties cannot be added to a view using ViewFields.Add, including binary properties, computed properties, and HTML or RTF body content. For more information, see Unsupported Properties in a Table Object or Table Filter.

    Finally, you can read about property tags at http://msdn.microsoft.com/en-us/library/office/ff868915(v=office.15).aspx. But I'd recommend using outlook spy or any other utility for exploring properties and finding their IDs.

    P.S. It is quite hard to compose the answer on a tablet, so excuse me for a poor formatting of the message.
    Thursday, August 7, 2014 7:22 PM
  • Thank you Eugene for your reply!

    I will try your suggestions. These Retention policy tags that I am talking about should be accessible as any other, I assume. Any example code to add UserDefinedProperty field to View xml? Would you suggest to put the code in an outlook add-in?

    Thanks again,

    Goran

    Thursday, August 7, 2014 8:42 PM
  • Yes, if you are going to distribute the solution on multiple PCs.

    See the XML property of the View class and Programmatically Adding a Column to Your Outlook 2007 Inbox Table View article for more information.

    Thursday, August 7, 2014 9:00 PM
  • Thank you Eugene!
    Tuesday, August 12, 2014 12:39 PM