Column Object (Word)

Represents a single table column. The Column object is a member of the Columns collection. The Columns collection includes all the columns in a table, selection, or range.

Use Columns(Index), where Index is the index number, to return a single Column object. The index number represents the position of the column in the Columns collection (counting from left to right).

The following example selects column one in table one in the active document.


Use the Column property with a Cell object to return a Column object. The following example deletes the text in cell one, inserts new text, and then sorts the entire column.

With ActiveDocument.Tables(1).Cell(1, 1) 
 .Range.InsertBefore "Sales" 
End With

Use the Add method to add a column to a table. The following example adds a column to the first table in the active document, and then it makes the column widths equal.

If ActiveDocument.Tables.Count >= 1 Then 
 Set myTable = ActiveDocument.Tables(1) 
 myTable.Columns.Add BeforeColumn:=myTable.Columns(1) 
End If


Use the Information property with a Selection object to return the current column number. The following example selects the current column and then displays the column number in a message box.

If Selection.Information(wdWithInTable) = True Then 
 MsgBox "Column " _ 
 & Selection.Information(wdStartOfRangeColumnNumber) 
End If