Solved

Printer Settings

Posted on 2003-12-12
2
423 Views
Last Modified: 2010-05-01
How can I write code to set margins so that text sent to the printer does not begin from the edge of the page?
0
Comment
Question by:Pi7
[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
  • 2
2 Comments
 
LVL 6

Expert Comment

by:prasitlee
ID: 9928375
Dear Pi7,
    Try the following link. I think it would give you an idea about how to set margin.
    http://www.vb-helper.com/tips7.htm
                                                               Meng
0
 
LVL 6

Accepted Solution

by:
prasitlee earned 50 total points
ID: 9928394
Dear Pi7,
     This is the part that is related to how to set margin.


Set Printer Margins
Use the Printer's scale properties to set margins. Set the properties so the position (0, 0) is mapped to where you want the margins. For example, the following code makes the left margin 0.5 inches and the top margin 0.75 inches. The factor of 1440 converts inches into twips.
    Printer.ScaleLeft = -0.5 * 1440
    Printer.ScaleTop = -0.75 * 1440
    Printer.CurrentX = 0
    Printer.CurrentY = 0
Unfortunately printers don't print exactly where you think they should. Try using this statement to print a box 1 inch from the upper left corner:
    Printer.Line (1440, 1440)-Step(1440, 1440)
See how far off it is. Try printing several times. If your printer is consistently off by some amount at the top and left, you may be able to get good results by subtracting these amounts from the margins you set.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JSON Response and request in VB6 application 11 1,073
VB6 - Convert HH:MM into Decimal 8 77
Help me. 3 79
VB6 - Scroll Mouse wheel on Picturebox 13 122
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

752 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