HowTo : How to Get the Printers Margins
Article | 41023671 |
Type | HowTo |
Product | Engine |
Version | 5.0.0.1033 |
Date Added | 8/11/2004 |
Submitted by | XTakis |
Keywords | |
Subject
How to Get the Printers Margins
Summary
How to Get the Printers Margins
Solution
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long
Private Const PHYSICALOFFSETX = 112
Private Const PHYSICALOFFSETY = 113
And then use these like this:
MarginLeft = GetDeviceCaps(Printer.hdc, PHYSICALOFFSETX)
MarginTop = GetDeviceCaps(Printer.hdc, PHYSICALOFFSETY)