代表视图中顺序字段或视图字段的显示属性。
备注
ColumnFormat 对象代表 OrderField 或 ViewField 对象的显示属性,例如对齐方式或字段类型。 使用 ViewField 对象的 ColumnFormat 属性可以访问视图字段的显示属性。
使用 Label 属性可以获取或更改用于为字段添加标签的文字,使用 Align 属性可以确定字段中内容的对齐方式。
使用 FieldType 属性可以确定该字段所显示数据的类型和形式,使用 FieldFormat 属性可以确定如何设置该字段的数据格式。
示例
(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 
 
属性
| 名称 | 
|---|
| Align | 
| 应用程序 | 
| 类 | 
| FieldFormat | 
| FieldType | 
| 标签 | 
| Parent | 
| Session | 
| Width | 
另请参阅
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。