' NOTE: To use the PrnInfo object, PrnInfo.dll must be registered. ' This can be done at a command prompt by typing ' regsvr32 prninfo.dll ' This script demonstrates only simple use of the printers collection ' to verify that printer page size is set to A4. If it is not, ' this script will pop up the printer settings dialog to allow ' instant modification. Set Prns = CreateObject("PrnInfo.CPrinters") Const DMPAPER_LETTER = 1 ' Letter 8 1/2 x 11 in Const DMPAPER_LEDGER = 4 ' Ledger 17 x 11 in Const DMPAPER_LEGAL = 5 ' Legal 8 1/2 x 14 in Const DMPAPER_EXECUTIVE = 7 ' Executive 7 1/4 x 10 1/2 in Const DMPAPER_A4 = 9 ' A4 210 x 297 mm Const DMPAPER_A4SMALL = 10 ' A4 Small 210 x 297 mm Const DMPAPER_A5 = 11 ' A5 148 x 210 mm Const DMPAPER_B4 = 12 ' B4 250 x 354 Const DMPAPER_B5 = 13 ' B5 182 x 257 mm For each Printer in Prns Set Mode = Printer.Devmode If Mode.PaperSize <> DMPAPER_A4 Then Printer.ShowPropertiesDialog End If Next
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question