Solved

Printer Settings

Posted on 2003-12-12
2
419 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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now