代表檢視中 ViewField 物件的集合。
註解
ViewFields 集合代表可在檢視中顯示的 Outlook 項目屬性。 使用 ViewFields 集合的 Add 方法,為從 View 物件衍生的下列物件新增檢視欄位:
在資料表檢視中, ViewFields 集合中 ViewField 物件的順序與欄位欄在資料表檢視中的顯示順序不同。 取得欄順序的因應措施是剖析 View.XML 屬性所傳回的字串。
範例
下列 VB) A (Visual Basic for Applications 範例會逐一查看目前 TableView 物件的 ViewFields 集合,顯示集合中每個 ViewField 物件的標籤與 XML 結構描述名稱。
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 |
| Insert |
| 項目 |
| Remove |
屬性
| 名稱 |
|---|
| Application |
| Class |
| Count |
| Parent |
| Session |
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。