Outlook) (ViewFields 对象

代表视图中 ViewField 对象的集合。

备注

ViewFields 集合表示可在视图中显示的 Outlook 项目属性。 从 视图 对象派生的使用要添加以下对象的视图字段的 ViewFields 集合的 Add 方法︰

在表视图中, ViewFieldViewFields 集合中的对象的顺序不是字段的列,在表视图中显示的顺序相同。 一种解决方法,以获得所列顺序是分析由 View.XML 属性返回的字符串。

示例

(VBA) 示例下面的 Visual Basic for Applications 循环 ViewFields 集合的当前的 表 对象在集合中显示的标签和 XML 架构的每个 ViewField 对象的名称。

Private Sub DisplayTableViewFields() 
 
 Dim objTableView As TableView 
 
 Dim objViewField As ViewField 
 
 Dim strOutput As String 
 
 
 
 If Application.ActiveExplorer.CurrentView.ViewType = _ 
 
 olTableView Then 
 
 
 
 ' Obtain a TableView object reference for the 
 
 ' current table view. 
 
 Set objTableView = _ 
 
 Application.ActiveExplorer.CurrentView 
 
 
 
 ' Iterate through the ViewFields collection for 
 
 ' the table view, obtaining the label and the 
 
 ' XML schema name for each field included in 
 
 ' the view. 
 
 For Each objViewField In objTableView.ViewFields 
 
 With objViewField 
 
 strOutput = strOutput & .ColumnFormat.Label & _ 
 
 " (" & .ViewXMLSchemaName & ")" & vbCrLf 
 
 End With 
 
 Next 
 
 
 
 ' Display a dialog box containing the concatenated 
 
 ' view field information. 
 
 MsgBox strOutput 
 
 End If 
 
End Sub 
 

方法

名称
Add
插入
项
Remove

属性

名称
Application
类
Count
Parent
Session

另请参阅

Outlook 对象模型引用

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。