Word) (Cell.Column 属性

返回代表包含指定单元格的表格列的 对象。 此为只读属性。

语法

表达式

expression 是必需的。 一个代表“Cell”对象的变量。

示例

本示例创建一个 3x5 表格并为偶数列设置底纹。

Dim tableNew As Table 
Dim cellLoop As Cell 
 
Selection.Collapse Direction:=wdCollapseStart 
Set tableNew = _ 
 ActiveDocument.Tables.Add(Range:=Selection.Range, _ 
 NumRows:=3, NumColumns:=5) 
 
For Each cellLoop In tableNew.Rows(1).Cells 
 If cellLoop.ColumnIndex Mod 2 = 0 Then 
 cellLoop.Column.Shading.Texture = wdTexture10Percent 
 End If 
Next cellLoop

另请参阅

单元格对象

支持和反馈

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