Top Property

Microsoft Publisher Visual Basic

Returns the a Single that represents the distance (in points) from the top edge of the workspace to the top edge of the page. Read-only.

expression.Top

expression    Required. An expression that returns one of the above objects.

ShowTop property as it applies to the PrintableRect object.

Returns the a Single that represents the distance (in points) from the top edge of the printer sheet to the top edge of the printable rectangle. Read-only.

expression.Top

expression    Required. An expression that returns one of the above objects.

ShowTop property as it applies to the Window object.

Returns or sets a Long that represents the distance between the top edge of the screen and the application window. Read/write.

expression.Top

expression    Required. An expression that returns one of the above objects.

ShowTop property as it applies to the Shape object.

Returns or sets a Variant that represents the distance between the top of the page and the top of a shape. Read/write.

expression.Top

expression    Required. An expression that returns one of the above objects.

ShowTop property as it applies to the ShapeRange object.

Returns a Variant that represents the distance between the top of the page and the top shape in a range of shapes. Read-only.

expression.Top

expression    Required. An expression that returns one of the above objects.

Example

ShowAs it applies to the Window object.

This example verifies that the state of application window is neither maximized nor minimized and then resizes the window and moves it to 150 points from the top of the screen.

Sub MoveWindow()
    With ActiveWindow
        If .WindowState = pbWindowStateNormal Then
            .Top = 150
            .Resize Width:=500, Height:=500
        End If
    End With
End Sub
				

ShowAs it applies to the Shape object.

This example changes the position, size, and type of shape of the first shape on the first page of the active publication. This example assumes there is at least one shape on the first page of the active publication.

Sub MoveSizeChangeShape()
    With ActiveDocument.Pages(1).Shapes(1)
        .Top = 72
        .Left = 72
        .Width = 150
        .Height = 150
        .AutoShapeType = msoShape5pointStar
    End With
End Sub