View.XML property

Returns or sets a String (string in C#) value that specifies the XML definition of the current view. Read/write.

Namespace:  Microsoft.Office.Interop.Outlook
Assembly:  Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)

string XML { get; set; }

Property value

Type: System.String

The XML definition describes the view type by using a series of tags and keywords corresponding to various properties of the view itself. When the view is created, the XML definition is parsed to render the settings for the new view.

To determine how the XML should be structured when creating views, you can create a view by using the Outlook user interface and then you can retrieve the XML property for that view.

To programmatically add a custom field to a view, use the Add(String) method. This is the recommended way to dynamically change the view over setting the View.XML property.