Share via


View.ActivePage Property

Publisher Developer Reference

Returns a Page object that represents the page currently displayed in the Microsoft Office Publisher window.

Syntax

expression.ActivePage

expression   A variable that represents a View object.

Return Value
Page

Example

This example saves the active page as a JPEG picture. (Note that PathToFile must be replaced with a valid file path for this example to work.)

Visual Basic for Applications
  Sub SavePageAsPicture()
    ActiveView.ActivePage.SaveAsPicture _
        FileName:="PathToFile"
End Sub

This example adds a horizontal ruler guide and a vertical ruler guide to the active page that intersect at the center point of the page.

Visual Basic for Applications
  Sub SetRulerGuidesOnActivePage()
    Dim intHeight As Integer
    Dim intWidth As Integer
With ActiveView.<strong class="bterm">ActivePage</strong>
    intHeight = .Height / 2
    intWidth = .Width / 2
    With .RulerGuides
        .Add Position:=intHeight, Type:=pbRulerGuideTypeHorizontal
        .Add Position:=intWidth, Type:=pbRulerGuideTypeVertical
    End With
End With

End Sub

See Also