Option Explicit
Private Sub Form_Load()
'
MsgBox MillimeterToPixel(10, Printer.TwipsPerPixelX)
'
End Sub
Private Function MillimeterToPixel(Millimeter As Single, TwipsPerPixel As Single) As Single
'
'There are approximately 1440 twips to an inch (the length of a screen item measuring one inch when printed).
'As there are 2.54 centimeters to 1 inch, then there are approximately 567 twips to a centimeter
'(the length of a screen item measuring one centimeter when printed).
'Or in millimeters, as there are 25.4 millimeters to 1 inch, therefore there are approximately 56.7 twips to
'a millimeter (the length of a screen item measuring one millimeter when printed).
Const sngTwipsPerMillimeter As Single = 56.7
MillimeterToPixel = Millimeter * (sngTwipsPerMillimeter / TwipsPerPixel)
'
End Function