View.ActivePage property (Publisher)
Returns a Page object that represents the page currently displayed in the Microsoft 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.
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.
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
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.