RelativeHorizontalPosition Property

Microsoft Word Visual Basic

Specifies to what the horizontal position of a frame, a shape, or a group of rows is relative. Read/write WdRelativeHorizontalPosition.

Can be one of the following WdRelativeHorizontalPosition constants.

wdRelativeHorizontalPositionCharacter

wdRelativeHorizontalPositionColumn

wdRelativeHorizontalPositionMargin

wdRelativeHorizontalPositionPage.

Example

ShowAs it relates to the wdRelativeHorizontalPositionMargin constant.

This example adds a frame around the selection and aligns the frame horizontally with the right margin.

Set myFrame = ActiveDocument.Frames.Add(Range:=Selection.Range)
With myFrame
    .RelativeHorizontalPosition = _
        wdRelativeHorizontalPositionMargin
    .HorizontalPosition = wdFrameRight
End With
				

ShowAs it relates to the wdRelativeHorizontalPositionPage constant.

This example repositions the selected shape object.

With Selection.ShapeRange
    .Left = InchesToPoints(0.6)
    .RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
    .Top = InchesToPoints(1)
    .RelativeVerticalPosition = wdRelativeVerticalPositionParagraph
End With