' Page setup dialog example CONST PSD_DEFAULTMINMARGINS = 0 CONST PSD_MINMARGINS = &H1 CONST PSD_MARGINS = &H2 CONST PSD_INTHOUSANDTHSOFINCHES = &H4 CONST PSD_INHUNDREDTHSOFMILLIMETERS = &H8 CONST PSD_DISABLEMARGINS = &H10 CONST PSD_DISABLEPRINTER = &H20 CONST PSD_NOWARNING = &H80 CONST PSD_DISABLEORIENTATION = &H100 CONST PSD_DISABLEPAPER = &H200 CONST PSD_RETURNDEFAULT = &H400 CONST PSD_SHOWHELP = &H800 CONST PSD_ENABLEPAGESETUPHOOK = &H2000 CONST PSD_ENABLEPAGESETUPTEMPLATE = &H8000 CONST PSD_ENABLEPAGESETUPTEMPLATEHANDLE = &H20000 CONST PSD_ENABLEPAGEPAINTHOOK = &H40000 CONST PSD_DISABLEPAGEPAINTING = &H80000 CONST PSD_NONETWORKBUTTON = &H200000 TYPE TPSD lStructSize AS LONG hWndOwner AS LONG hDevMode AS LONG hDevNames AS LONG Flags AS LONG ptPaperSizeX AS LONG ptPaperSizeY AS LONG rtMinMarginLeft AS LONG rtMinMarginTop AS LONG rtMinMarginRight AS LONG rtMinMarginBottom AS LONG rtMarginLeft AS LONG rtMarginTop AS LONG rtMarginRight AS LONG rtMarginBottom AS LONG hInstance AS LONG lParam AS LONG lpfnPageSetupHook AS LONG lpfnPagePaintHook AS LONG lpPageSetupTemplate AS LONG hPageSetupTemplate AS LONG END TYPE DECLARE FUNCTION PageSetupDlg LIB "COMDLG32" ALIAS "PageSetupDlgA" _ (Ptr AS TPSD) AS LONG DIM PSD AS TPSD PSD.lStructSize = SIZEOF(PSD) PSD.Flags = PSD_MINMARGINS + PSD_MARGINS PSD.hWndOwner = 0 PRINT IIF(PageSetupDlg(PSD), "Start printing", "Cancel print") ?PSD.rtMarginLeft ?PSD.rtMarginTop ?PSD.rtMarginRight ?PSD.rtMarginBottom