you can use the ScaleWidth and ScaleHeight properties of the Printer object to determine the size of the printable area, that depends the printer settings, the paper/tray is currently loaded. You can set the units you want using the ScaleMode property. In your case:
Printer.ScaleMode = vbMillimeters
maxWidth = Printer.ScaleWidth
maxHeight = Printer.ScaleHeight
PS I suggest you to "trim" the size a little, just by few millimeters, to be extra sure
"There are two ways to write error-free programs. Only the third one works."