VerticalPosition Property

Applies To

Frame object.

Description

Returns or sets the vertical distance between the edge of the frame and the item specified by the RelativeVerticalPosition property. Can be a number that indicates a measurement in points, or can be one of the following WdFramePosition constants: wdFrameTop, wdFrameBottom, or wdFrameCenter. Read/write Single.

See Also

RelativeVerticalPosition property.

Example

This example aligns the first frame in the active document vertically with the top of the page.

Set myFrame = ActiveDocument.Frames(1)
With myFrame
    .RelativeVerticalPosition = wdRelativeVerticalPositionPage
    .VerticalPosition = wdFrameTop
End With
This example adds a frame around the first shape in the active document and positions the frame 1 inch from the top margin.

If ActiveDocument.Shapes.Count >= 1 Then
    ActiveDocument.Shapes(1).Select
    Set aFrame = ActiveDocument.Frames.Add(Range:=Selection.Range)
    With aFrame
        .RelativeVerticalPosition = wdRelativeVerticalPositionMargin
        .VerticalPosition = InchesToPoints(1)
    End With
End If