Rediger

Del via


BusinessCardView.XML property (Outlook)

Returns or sets a String value that specifies the XML definition of the current view. Read/write.

Syntax

expression.XML

expression An expression that returns a BusinessCardView object.

Remarks

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, create a view by using the Outlook user interface and then retrieve the XML property for that view.

Example

The following Visual Basic for Applications (VBA) example enumerates the Views collection of the Contacts default folder and displays the XML definition of a BusinessCardView object named "Card View".

Sub DisplayBusinessCardViewDef() 
 
 Dim objName As NameSpace 
 
 Dim objViews As Views 
 
 Dim objView As BusinessCardView 
 
 
 
 ' Get the Views collection of the Contacts default folder. 
 
 Set objName = Application.GetNamespace("MAPI") 
 
 Set objViews = objName.GetDefaultFolder(olFolderContacts).Views 
 
 
 
 ' Return a view called "Card View." If the view 
 
 ' doesn't already exist, create it. 
 
 Set objView = objViews.Item("Card View") 
 
 If objView Is Nothing Then 
 
 Set objView = objViews.Add( _ 
 
 "Card View", _ 
 
 olBusinessCardView, _ 
 
 olViewSaveOptionAllFoldersOfType) 
 
 End If 
 
 
 
 ' Display the XML definition for the view. 
 
 ' Note that the definition may be truncated 
 
 ' due to the display limitations of the 
 
 ' MsgBox function. 
 
 MsgBox objView.XML 
 
End Sub

See also

BusinessCardView Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.