Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Change Paper Size for System Printer

Posted on 2006-10-31
14
Medium Priority
?
877 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 1500 total points
ID: 17878495
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…
Suggested Courses

618 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