共用方式為


Outlook) (ViewField 物件

代表用來在檢視中顯示資訊的檢視欄位。

註解

使用ViewFields集合的Add方法,將 Outlook 專案屬性新增至衍生自View物件的下列物件:

使用 ColumnFormat 屬性可存取 ColumnFormat 物件,此物件代表與檢視欄位相關聯的顯示內容。 使用 ViewXMLSchemaName 屬性取得檢視表的 XML 定義中所參考的檢視欄位名稱。

範例

下列 Visual Basic for Applications (VBA) 範例會逐一查看目前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 
 

屬性

名稱
Application
Class
ColumnFormat
Parent
Session
ViewXMLSchemaName

另請參閱

Outlook 物件模型參考

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應