Share via


YOffsetWithinReaderSpread Property.YOffsetWithinReaderSpread Property

Publisher Developer Reference

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

Syntax

expression.YOffsetWithinReaderSpread

expression   A variable that represents a YOffsetWithinReaderSpread Property object.

Return Value
Single

Example

This example creates a shape on the second and third pages of the active publication and then sets the position of the shape on the third page to the diagonally opposite corner of the page from the shape on the second page. For this example to work, the active publication must have at least three pages.

Visual Basic for Applications
  Sub OffsetShapePositions()
    Dim shpOne As Shape
    Dim intLeft As Integer
    Dim intTop As Integer
    Dim intWidth As Integer
    Dim intHeight As Integer
With ActiveDocument
    .ViewTwoPageSpread = True

    With .Pages
        intWidth = 150
        intHeight = 150
        intLeft = (.Item(2).Width / 2) - intWidth
        intTop = InchesToPoints(7)

        Set shpOne = .Item(2).Shapes.AddShape _
            (Type:=msoShape5pointStar, Left:=intLeft, _
            Top:=intTop, Width:=intWidth, Height:=intHeight)

        intLeft = (.Item(3).XOffsetWithinReaderSpread - _
            .Item(2).XOffsetWithinReaderSpread) + (.Item(2) _
            .Width - shpOne.Left - shpOne.Width)
        intTop = (.Item(3).<strong>YOffsetWithinReaderSpread</strong> - _
            .Item(2).<strong>YOffsetWithinReaderSpread</strong>) + (.Item(2) _
            .Height - shpOne.Top - shpOne.Height)

        .Item(2).Shapes.AddShape Type:=msoShape5pointStar, _
            Left:=intLeft, Top:=intTop, Width:=intWidth, _
            Height:=intHeight
    End With
End With

End Sub

See Also