WksPageSetup Object
The WksPageSetup object contains all the parameters in the worksheet window Page Setup dialog.
The following table provides the properties of the WksPageSetup object:
Property |
Description |
Returns/sets the printing enlargement or reduction percentage. A value of zero indicates that reduction should be done according to the FitToPagesAcross and FitToPagesDown settings. |
|
Returns the Application object. It is a read-only property. |
|
Returns/sets the bottom margin distance. |
|
Returns/sets whether to center the output horizontally. |
|
Returns/sets whether to center the output vertically. |
|
Returns/sets the maximum number of pages across to print. |
|
Returns/sets the maximum number of pages down to print. |
|
Returns/sets the page footer text. |
|
Returns/sets the footer margin distance. |
|
Returns/sets the page header text. |
|
Returns/sets the header margin distance. |
|
Returns/sets the left margin distance. |
|
Returns/sets the page orientation (landscape or portrait). |
|
Returns/sets the paper size. |
|
Returns/sets the printer paper bin. |
|
Returns the worksheet associated with this PageSetup object. It is a read-only property. |
|
Returns/sets whether multiple pages will be printed across rows first and then down (versus down columns first and then across). |
|
Returns/sets whether output will be forced to be in black and white. |
|
Returns/sets whether grid lines will be printed. |
|
Returns/sets whether row and column headers will be printed. |
|
Returns/sets the right margin distance. |
|
Returns/sets the top margin distance. |
Example
The following script demonstrates how the WksPageSetup object is used in reference to the WksDocument object.
Sub Main
'Declares SurferApp as an object
Dim SurferApp As Object
'Creates an instance of the Surfer Application object and assigns it
'to the variable named "SurferApp"
Set SurferApp = CreateObject("Surfer.Application")
'Makes Surfer visible
SurferApp.Visible = True
'Declares Wks as an object
Dim Wks As Object
'Creates a worksheet document in Surfer and assigns it to the variable
'named "Wks"
Set Wks = SurferApp.Documents.Add(srfDocWks)
'Declares WksPageSetup as an object
Dim WksPageSetup As Object
'Assigns the worksheet document page setup to the variable named
'"WksPageSetup"
Set WksPageSetup = Wks.PageSetup
End Sub