Cells.SetWidth Method
Word Developer Reference |
Sets the width of columns or cells in a table.
Syntax
expression.SetWidth(ColumnWidth, RulerStyle)
expression Required. A variable that represents a Cells collection.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
ColumnWidth | Required | Single | The width of the specified column or columns, in points. |
RulerStyle | Required | WdRulerStyle | Controls the way Word adjusts cell widths. |
Remarks
The WdRulerStyle behavior described above applies to left-aligned tables. The WdRulerStyle behavior for center- and right-aligned tables can be unexpected; in these cases, the SetWidth method should be used with care.
Example
This example creates a table in a new document and sets the width of the first cell in the second row to 1.5 inches. The example preserves the widths of the other cells in the table.
Visual Basic for Applications |
---|
|
This example sets the width of the cell that contains the insertion point to 36 points. The example also narrows the first column to preserve the position of the right edge of the table.
Visual Basic for Applications |
---|
|
See Also