Share via


Column Property

Column Property"/>   Column property as it applies to the Bookmark object.True if the specified bookmark is a table column. Read-only Boolean. expression.Columnexpression   Required. An expression that returns one of the objects in the Applies TO list.    Column property as it applies to the Cell object. Returns a read-only Column object that represents the table column containing the specified cell. expression.Columnexpression   Required. An expression that returns one of the objects in the Applies To list. As it applies to the Bookmark object. This example creates a table with a bookmark and then displays a message box that confirms that the bookmark is a table column. Dim docNew As Document Dim tableNew As Table Dim rangeCell As Range Set docNew = Documents.Add Set tableNew = docNew.Tables.Add(Selection.Range, 3, 5) Set rangeCell = tableNew.Cell(3,5).Range rangeCell.InsertAfter "Cell(3,5)" docNew.Bookmarks.Add Name:="BKMK_Cell35", Range:=rangeCell MsgBox docNew.Bookmarks(1).ColumnAs it applies to the Cell object. This example creates a 3x5 table and applies shading to the even-numbered columns. 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

Example