Solved

Change the Printer Paper Size

Posted on 2001-06-29
10
301 Views
Last Modified: 2008-02-01
I need to know how I can change the default printers paper size to legal.
0
Comment
Question by:CodeHead
10 Comments
 
LVL 11

Expert Comment

by:Otana
ID: 6237052
try this:

Dim vPrinter As Printer
Dim vSize As PrinterObjectConstants

vSize = vbPRPSLegal
vPrinter.PaperSize = vSize
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6237347
Also, hope you will need to have installed the latest Service Pack for VB.
0
 
LVL 1

Author Comment

by:CodeHead
ID: 6241320
Otana,
I tried this then opened up my printer and it did not change the setting.  
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 22

Expert Comment

by:rspahitz
ID: 6249758
The above comment would change the settings for the current VB session.

You can try applying directly to the current (default) printer:

Printer.PaperSize = vbPRPSLegal

I think this will change the Windows settings rather than the settings for the application.
0
 
LVL 1

Author Comment

by:CodeHead
ID: 6249777
I tried to apply it directly to the printer and it did not work.  The component will be used through Access to change the printer settings so I am not sure if it would work.  I want to be able to change the setting and have the property box reflect the changes.
0
 
LVL 9

Accepted Solution

by:
Valliappan AN earned 80 total points
ID: 6251171
I think you should have atleast VB Service Pack 2 to do the default printer change with Printer object in VB. or, you could use the class, just given in the freevbcode link below. Look at the links:

http://support.microsoft.com/support/kb/articles/Q167/7/35.ASP
(FIX: Setting Printer to Item in the Printers Collection Fails)
http://www.freevbcode.com/ShowCode.Asp?ID=641
(this can be used to change default printer)

Refer this link, hope, you could do some modifications here to do your paper size changing:
http://support.microsoft.com/support/kb/articles/Q180/6/45.ASP
(FIX: Cannot Change Page Settings During Print Job)

Hope this helps.
0
 
LVL 17

Expert Comment

by:inthedark
ID: 6258314
Add the following:

Printer.TrackDefault = True

Befor changing printer settings.

0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7020352
You have 18 open questions today, all of which need your attention.  ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101, Netminder, Mindphaser or I will return to finalize these as soon as possible if after 7 days no response by the Asker.  EXPERTS-->  please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.12036479.html
http://www.experts-exchange.com/questions/Q.20009996.html
http://www.experts-exchange.com/questions/Q.20010855.html
http://www.experts-exchange.com/questions/Q.20069067.html
http://www.experts-exchange.com/questions/Q.20081532.html
http://www.experts-exchange.com/questions/Q.20090911.html
http://www.experts-exchange.com/questions/Q.20101218.html
http://www.experts-exchange.com/questions/Q.20107838.html
http://www.experts-exchange.com/questions/Q.20108744.html
http://www.experts-exchange.com/questions/Q.20113500.html
http://www.experts-exchange.com/questions/Q.20115787.html
http://www.experts-exchange.com/questions/Q.11486298.html
http://www.experts-exchange.com/questions/Q.20133500.html
http://www.experts-exchange.com/questions/Q.20142611.html
http://www.experts-exchange.com/questions/Q.20143201.html
http://www.experts-exchange.com/questions/Q.20145267.html
http://www.experts-exchange.com/questions/Q.20245016.html
http://www.experts-exchange.com/questions/Q.20296474.html



*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643 
------> POINTS FOR EXPERTS awaiting comments are listed in the links below
http://www.experts-exchange.com/commspt/Q.20277028.html (Part 1)
http://www.experts-exchange.com/jsp/qShow.jsp?ta=commspt&qid=20295853 (Part 2)
 
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thanks everyone.
Moondancer
Moderator @ Experts Exchange
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7139948
Hi CodeHead,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept valli_an's comment(s) as an answer.

CodeHead, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7173400
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…

786 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