ActivePage Property

Microsoft Publisher Visual Basic

object that represents the page currently displayed in the Publisher window.

expression.ActivePage

expression    Required. An expression that returns one of the objects in the Applies To list.

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.)

Sub SavePageAsPicture()
    ActiveView.ActivePage.SaveAsPicture _
        FileName:="PathToFile"
End Sub
		

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

Sub SetRulerGuidesOnActivePage()
    Dim intHeight As Integer
    Dim intWidth As Integer

    With ActiveView.ActivePage
        intHeight = .Height / 2
        intWidth = .Width / 2
        With .RulerGuides
            .Add Position:=intHeight, Type:=pbRulerGuideTypeHorizontal
            .Add Position:=intWidth, Type:=pbRulerGuideTypeVertical
        End With
    End With
End Sub