Sample: PageSet.exe Programmatically Changes Default Printer OrientationID: Q198901
|
PageSet.exe is a self-extracting executable file that contains a DLL file that allows you to programmatically change the printer orientation.
This DLL is particularly useful when dealing with the Data Report, which reads the default printer orientation prior to displaying or printing a report. PageSet.exe allows you to programmatically change and reset your printer orientation.
The following file is available for download from the Microsoft
Software Library:
PageSet.exeRelease Date: Apr-13-1999
Q119591 How to Obtain Microsoft Support Files from Online Services
On Windows NT systems, PageSet.dll requires administrative access to your printer settings. To set this up, you will have to save the driver settings to your local computer, which can be accomplished with the following steps:
FileName Size PageSet.dll 1KB PageSet.vbp 1KB frmSit.frm 1KB Orient.bas 8KB PrinterControl.cls 1KB Readme.txt 1KB
regsvr32.exe <full path to dll>\pageset.dll
Paste the following code in the General Declaration section of your form:
Dim obj As PageSet.PrinterControl
Private Sub Command1_Click()
On Error GoTo errorhandler:
Set obj = New PrinterControl
obj.ChngOrientationLandscape
DataReport1.Show
DataReport1.PrintReport False, rptRangeFromTo, 1, 1
Exit Sub
errorhandler:
MsgBox Err.Description
obj.ReSetOrientation
End Sub
Private Sub Form_Unload(Cancel As Integer)
obj.ReSetOrientation 'This resets the printer to portrait.
End Sub
Additional query words: kbDSupport kbdse
Keywords : kbfile kbReportWriter kbDataEnv kbGrpVBDB
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbinfo
Last Reviewed: April 14, 1999