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

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



_表达式_一个返回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** 集合, 并显示名为 "卡片视图" 的**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

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.