ruskker
asked on
Change Paper Size for System Printer
How do I modify the System Default Printer Settings (not the VB Printer.) to change to legal paper?
OH, I messed up. I did not read your question carefully. You want to set the legal paper not the default printer. My bad. Ignore the two previous posts.
ASKER
Thanks anyway lunchbyte.
I'm still really in need of a solution on how to set the System default printer paper size (not the VB Printer object).
The program launches AcrobatReader and I want to force the printout to be 14" - otherwise, Adobe will adapt to the current paper size.
I'm still really in need of a solution on how to set the System default printer paper size (not the VB Printer object).
The program launches AcrobatReader and I want to force the printout to be 14" - otherwise, Adobe will adapt to the current paper size.
Long shot but try
Printer.PaperSize = vbPRPSLegal
then your code that you use to open the acrobat reader.
I am not sure if acrobat reader will override it and put it back to default setting but try it.
Printer.PaperSize = vbPRPSLegal
then your code that you use to open the acrobat reader.
I am not sure if acrobat reader will override it and put it back to default setting but try it.
ASKER
We have tried this, but it only affects the printer within the VB process. Acrobat Reader starts as a new process and picks up the system default printer settings.
This should help
huh? What will help? oleggold
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=imper sonate}!\\ " & strComputer & "\root\cimv2")
Set colPrinters = objWMIService.ExecQuery _
("Select * From Win32_Printer where DeviceName = 'EPSON AL-C1900 Advanced' ")
For Each objPrinter in colPrinters
objPrinter.PaperSize = "Legal"
objPrinter.Put
Next
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=imper
Set colPrinters = objWMIService.ExecQuery _
("Select * From Win32_Printer where DeviceName = 'EPSON AL-C1900 Advanced' ")
For Each objPrinter in colPrinters
objPrinter.PaperSize = "Legal"
objPrinter.Put
Next
Set objWMIService = GetObject("winmgmts:{imper sonationLe vel=impers onate}!\\. \root\cimv 2")
Set colInstalledPrinters = objWMIService.ExecQuery ("Select * from Win32_Printer")
For Each objPrinter in colInstalledPrinters
Wscript.Echo "Name: " & objPrinter.Name & " Location: " & objPrinter.Location
'set the paper type
objPrinter.CurrentPaperTyp e = 22 ' Don't know the number for legal but this code cahnge to A4 size...
Next
Set colInstalledPrinters = objWMIService.ExecQuery ("Select * from Win32_Printer")
For Each objPrinter in colInstalledPrinters
Wscript.Echo "Name: " & objPrinter.Name & " Location: " & objPrinter.Location
'set the paper type
objPrinter.CurrentPaperTyp
Next
ASKER
Hi JackOfPH
This is getting closer, but I get err 438 Object doesn't support this property or method on the
objprinter.CurrentPaperTyp e = 8 '(I think it's 8 for legal)
Any suggestions??
Ps. On your first comment, I got err 438 also
This is getting closer, but I get err 438 Object doesn't support this property or method on the
objprinter.CurrentPaperTyp
Any suggestions??
Ps. On your first comment, I got err 438 also
try this example...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://freevbcode.com/ShowCode.Asp?ID=641