Solved

Printer Settings

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Suggested Courses
Course of the Month7 days, 23 hours left to enroll

617 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