This documentation is archived and is not being maintained.

TextFrame.HorizontalAnchor Property (Word)

Returns or sets the horizontal alignment of text in a text frame. Read/write MsoHorizontalAnchorMsoHorizontalAnchor.

Version Added: Word 2010

expression .HorizontalAnchor

expression A variable that represents a TextFrame object.

The following code example shows how to set the alignment for the first shape in the active document to top center.

Public Sub HorizontalAnchor_Example() 
 
 With ActiveDocument.Shapes(1) 
 .TextFrame.HorizontalAnchor = msoAnchorCenter 
 .TextFrame.VerticalAnchor = msoAnchorTop 
 End With 
 
End Sub
Show: