ACC1x: Using PrtDevMode Property to Set Print Setup Dialog BoxID: Q109828
|
This article describes the PrtDevMode property. While this property is documented in the Microsoft Access Distribution Kit (ADK) documentation, the information applies to the retail product as well.
The PrtDevMode property sets or returns the device mode information
specified in the Print Setup dialog box for a datasheet, form, report, or
module.
The PrtDevMode property setting is a 64-byte structure that mirrors the
DEVMODE structure defined in the Microsoft Windows Software Development Kit
(SDK). The PrtDevMode property has the following members:
Constant Value
--------------------------
DM_ORIENTATION &H0000001
DM_PAPERSIZE &H0000002
DM_PAPERLENGTH &H0000004
DM_PAPERWIDTH &H0000008
DM_SCALE &H0000010
DM_COPIES &H0000100
DM_DEFAULTSOURCE &H0000200
DM_PRINTQUALITY &H0000400
DM_COLOR &H0000800
DM_DUPLEX &H0001000
DM_YRESOLUTION &H0002000
DM_TTOPTION &H0004000
Value Meaning
-------------------------------------------
1 Letter (8.5 x 11 in.)
2 Letter Small (8.5 x 11 in.)
3 Tabloid (11 x 17 in.)
4 Ledger (17 x 11 in.)
5 Legal (8.5 x 14 in.)
6 Statement (5.5 x 8.5 in.)
7 Executive (7.25 x 10.5 in.)
8 A3 (297 x 420 mm)
9 A4 (210 x 297 mm)
10 A4 Small (210 x 297 mm)
11 A5 (148 x 210 mm)
12 B4 (250 x 354)
13 B5 (182 x 257 mm)
14 Folio (8.5 x 13 in.)
15 Quarto (215 x 275 mm)
16 11 x 17 in.
18 Note (8.5 x 11 in.)
19 Envelope #9 (3.875 x 8.875 in.)
20 Envelope #10 (4.125 x 9.5 in.)
21 Envelope #11 (4.5 x 10.375 in.)
22 Envelope #12 (4.75 x 11 in.)
23 Envelope #14 (5 x 11.5 in.)
24 C size sheet (17 x 22 in.)
25 D size sheet (22 x 34 in.)
26 E size sheet (34 x 44 in.)
27 Envelope DL (110 x 220 mm)
28 Envelope C5 (162 x 229 mm)
29 Envelope C3 (324 x 458 mm)
30 Envelope C4 (229 x 324 mm)
31 Envelope C6 (114 x 162 mm)
32 Envelope C65 (114 x 229 mm)
33 Envelope B4 (250 x 353 mm)
34 Envelope B5 (176 x 250 mm
35 Envelope B6 (176 x 125 mm)
36 Envelope (110 x 230 mm)
37 Envelope Monarch (3.875 x 7.5 in.)
38 6-3/4 Envelope (3.625 x 6.5 in.)
39 US Std Fanfold (14.875 x 11 in.)
40 German Std Fanfold (8.5 x 12 in.)
41 German Legal Fanfold (8.5 x 13 in.)
256 User-defined
Value Meaning
---------------------------------------
1 Upper or only one bin
2 Lower bin
3 Middle bin
4 Manual bin
5 Envelope bin
6 Envelope manual bin
7 Automatic bin
8 Tractor bin
9 Small-format bin
10 Large-format bin
11 Large-capacity bin
14 Cassette bin
256 Device-specific bins start here
Value Meaning
-------------------------
-4 High resolution
-3 Medium resolution
-2 Low resolution
-1 Draft resolution
Value Meaning
------------------
1 Color
2 Monochrome
Value Meaning
------------------
1 Simplex
2 Horizontal
3 Vertical
Function SetCopies (MyReport As String, Copies As Integer)
Dim dm As zwtDevModeStr
Dim DevMode As zwtDeviceMode
DoCmd Echo False
DoCmd OpenReport MyReport, A_DESIGN
If Not IsNull(Reports(MyReport).PrtDevMode) Then
dm.rgb = Reports(MyReport).PrtDevMode
LSet DevMode = dm
DevMode.dmCopies = Copies
Devmode.dmFields = DM_COPIES
LSet dm = DevMode
Reports(MyReport).PrtDevMode = dm.rgb
DoCmd SetWarnings False
DoCmd DoMenuItem 7, A_FILE, 2
DoCmd Close A_REPORT, MyReport
DoCmd SetWarnings True
End If
DoCmd Echo True
End Function
Sub SetPaperSize (MyReport As String, MyPaperSize As Integer)
Dim dm As zwtDevModeStr
Dim DevMode As zwtDeviceMode
DoCmd Echo False
DoCmd OpenReport MyReport, A_DESIGN
If Not IsNull(Reports(MyReport).PrtDevMode) Then
dm.rgb = Reports(MyReport).PrtDevMode
LSet DevMode = dm
DevMode.dmPaperSize = MyPaperSize
LSet dm = DevMode
Reports(MyReport).PrtDevMode = dm.rgb
DoCmd SetWarnings False
DoCmd DoMenuItem 7, A_FILE, 2
DoCmd Close A_REPORT, MyReport
DoCmd SetWarnings True
End If
DoCmd Echo True
End Sub
Microsoft Access "The Secrets of AccessWizards," pages 21-26 (NOTE: This manual is available from Microsoft Sales Information Center at 1 (800) 426-9400. It is part number 077-050-039, and costs $9.95.)
Keywords : kbprint PtrOthr
Version : 1.0 1.1
Platform : WINDOWS
Issue type : kbinfo
Last Reviewed: April 2, 1999