Solved

Change Paper Size for System Printer

Posted on 2006-10-31
14
850 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

948 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now