Cell.VerticalAlignment Property

Word Developer Reference

Returns or sets the vertical alignment of text in one or more cells of a table. Read/write WdCellVerticalAlignment.

Syntax

expression.VerticalAlignment

expression   Required. A variable that represents a Cell object.

Example

This example creates a 3x3 table in a new document and assigns a sequential cell number to each cell in the table. The example then sets the height of the first row to 20 points and vertically aligns the text at the top of the cells.

Visual Basic for Applications
  Set newDoc = Documents.Add
Set myTable = newDoc.Tables.Add(Selection.Range, 3, 3)
i = 1
For Each c In myTable.Range.Cells
    c.Range.InsertAfter "Cell " & i
    i = i + 1
Next
With myTable.Rows(1)
    .Height = 20
    .Cells.VerticalAlignment = wdAlignVerticalTop
End With

See Also