HorizontalPosition Property Example

This example aligns the first frame in the active document horizontally with the right margin.

If ActiveDocument.Frames.Count >= 1 Then
    With ActiveDocument.Frames(1)
        .RelativeHorizontalPosition = _
            wdRelativeHorizontalPositionMargin
        .HorizontalPosition = wdFrameRight
    End With
End If

This example aligns the first table in the active document horizontally with the right margin.

If ActiveDocument.Tables.Count >= 1 Then
    With ActiveDocument.Tables(1).Rows
        .RelativeHorizontalPosition = _
            wdRelativeHorizontalPositionMargin
        .HorizontalPosition = wdTableRight
    End With
End If