Class Columns (Word VBA)

A collection of Column objects that represent the columns in a table.

The classes Range, Selection and Table. give access to class Columns


Dim clms as Columns
Set clms = ActiveDocument.Range.Columns

For Each

Here is an example of processing the Columns items in a collection.


Dim clm As Column
For Each clm In ActiveDocument.Range.Columns
	
Next clm

Methods

Add - Returns a Column object that represents a column added to a table.

AutoFit - Changes the width of a table column to accommodate the width of the text without changing the way text wraps in the cells.

Delete - Deletes the specified columns.

DistributeWidth - Adjusts the width of the specified columns so that they are equal.

Item - Returns an individual Column object in a collection.

Select - Selects the specified table columns.

SetWidth - Sets the width of columns in a table.

Properties

Borders returns a Borders collection that represents all the borders for the specified columns.

Count returns a Long that represents the number of columns in the collection.

First returns a Column object that represents the first item in the Columns collection.

Last returns a Column object that represents the last column in a table.

NestingLevel returns the nesting level of the specified columns.

PreferredWidth returns or sets the preferred width (in points or as a percentage of the window width) for the specified columns.

PreferredWidthType returns or sets the preferred unit of measurement to use for the width of the specified cells, columns, or table.

Shading returns a Shading object that refers to the shading formatting for the specified table columns.

Width returns or sets the width of the specified columns, in points.