Solved

Printer Settings

Posted on 2003-12-12
2
422 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
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 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…

828 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