printer's physical margins

  • Thread starter Thread starter sdomagal sdomagal via AccessMonster.com
  • Start date Start date
Just put 0 in the desired Margin prop TextBoxes. Access will
automagically reset them to the currently selected Printer minimums.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"sdomagal sdomagal via AccessMonster.com" <[email protected]>
wrote in message
news:[email protected]...
 
i want to read margins in code to format print page, i need some api's
functions, but dont know which
 
It's easy in VB because the handle to the Device Context is available
via its Printer object but unfortunately this is not the case in VBA for
Access.
If you look at the code in the ReportUtilities on my site you will find
sample code showing you how to do something like:

Global Const PHYSICALWIDTH = 110
Global Const PHYSICALHEIGHT = 111
Global Const PHYSICALOFFSETX = 112
Global Const PHYSICALOFFSETY = 113


Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal
nIndex As Long) As Long


Sub GetPrinterMarginsInTwips(ByRef XOffset As Long, ByRef YOffset As
Long)


XOffset = GetDeviceCaps(Printer.hDC, PHYSICALOFFSETX)
XOffset = XOffset * Printer.TwipsPerPixelX
YOffset = GetDeviceCaps(Printer.hDC, PHYSICALOFFSETY)
YOffset = YOffset * Printer.TwipsPerPixelY


End Sub




--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"sdomagal sdomagal via AccessMonster.com" <[email protected]>
wrote in message
news:[email protected]...
 
Back
Top