The following operation code uses the data item WINPRINT-MEDIA (defined in "winprint.def") to access the paper sizes and paper trays supported by a printer driver.
More:
WINPRINT-GET-PRINTER-MEDIA