BusinessCardView.XML 属性 (Outlook)BusinessCardView.XML Property (Outlook)

返回或设置一个String值,指定当前视图的 XML 定义。Returns or sets a String value that specifies the XML definition of the current view. 为可读/写属性。Read/write.


expressionexpression. XML

_表达式_一个返回BusinessCardView对象的表达式。expression An expression that returns a BusinessCardView object.


XML 定义使用一系列与视图本身各种属性对应的标记和关键字来描述视图的类型。The XML definition describes the view type by using a series of tags and keywords corresponding to various properties of the view itself. 创建视图时,通过解析 XML 定义来设置新视图。When the view is created, the XML definition is parsed to render the settings for the new view.

若要确定如何 XML 结构应创建视图时,通过使用 Outlook 用户界面创建视图,然后检索该视图的XML属性。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.


下面的 Visual Basic for Applications (VBA) 示例枚举联系人默认文件夹的**Views** 集合并显示一个名为"Card View"的**BusinessCardView** 对象的 XML 定义。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, _ 
 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 对象BusinessCardView Object