Solved

Change Paper Size for System Printer

Posted on 2006-10-31
14
846 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

743 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

15 Experts available now in Live!

Get 1:1 Help Now