I'm trying to create a table and center the text within vertically. When I create the table, I fill the cell with text and apply the alignment:
Dim pg As Page
Dim tbl As Shape
Set pg = ActiveDocument.ActiveView.ActivePage
Set tbl = pg.Shapes.AddTable(1, 1, InchesToPoints(3), InchesToPoints(5), InchesToPoints(2), InchesToPoints(1))
With tbl.Table.Rows(1).Cells(1)
.TextRange.Text = "Hello, World!"
.VerticalTextAlignment = pbVerticalTextAlignmentCenter
End With
However, the text doesn't vertically align properly. When I look in the Cell Properties tab under "Format Table," I see it is set to "Middle" vertical alignment already, but will only apply this once I hit "OK" (If I hit cancel, nothing changes).
It doesn't matter if I change the text before or after the alignment is applied. Anyone have any ideas on why this is happening?