Solved

Change Paper Size for System Printer

Posted on 2006-10-31
14
857 Views
Last Modified: 2010-05-18
How do I modify the System Default Printer Settings (not the VB Printer.) to change to legal paper?

0
Comment
Question by:ruskker
  • 5
  • 4
  • 3
  • +1
14 Comments
 
LVL 5

Expert Comment

by:lunchbyte
ID: 17844570
0
 
LVL 5

Expert Comment

by:lunchbyte
ID: 17844631
0
 
LVL 5

Expert Comment

by:lunchbyte
ID: 17844643
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.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:ruskker
ID: 17845234
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.
0
 
LVL 5

Expert Comment

by:lunchbyte
ID: 17845400
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.
0
 

Author Comment

by:ruskker
ID: 17845668
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.
0
 
LVL 21

Expert Comment

by:oleggold
ID: 17849955
This should help
0
 
LVL 5

Expert Comment

by:lunchbyte
ID: 17849974
huh? What will help? oleggold
0
 
LVL 15

Expert Comment

by:JackOfPH
ID: 17855288
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & 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
0
 
LVL 15

Expert Comment

by:JackOfPH
ID: 17855523
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
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.CurrentPaperType = 22 ' Don't know the number for legal but this code cahnge to A4 size...
Next
0
 

Author Comment

by:ruskker
ID: 17862937
Hi JackOfPH

This is getting closer, but I get err 438 Object doesn't support this property or method on the

objprinter.CurrentPaperType = 8  '(I think it's 8 for legal)

Any suggestions??

Ps. On your first comment, I got err 438 also
0
 
LVL 15

Expert Comment

by:JackOfPH
ID: 17878493
try this example...
0
 
LVL 15

Accepted Solution

by:
JackOfPH earned 500 total points
ID: 17878495
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question