代表檢視中順序欄位或檢視欄位的顯示屬性。
註解
ColumnFormat 物件代表 OrderField 或 ViewField 物件的顯示屬性,例如對齊方式或欄位類型。 使用 ViewField 物件的 ColumnFormat 屬性來存取檢視欄位的顯示屬性。
使用 Label 屬性以取得或變更用來為欄位加上標籤的文字,或使用 Align 屬性來決定欄位內內容的對齊方式。
使用 FieldType 屬性來決定針對該欄位所顯示的資料類型和形式,並使用 FieldFormat 屬性來決定如何格式化該欄位的資料。
範例
下列 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
屬性
| 名稱 |
|---|
| Align |
| Application |
| Class |
| FieldFormat |
| FieldType |
| Label |
| Parent |
| Session |
| Width |
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。