I originally created this post a while ago : How to set Paper Size being passed from Printer Selection , and I never got it to work.
Here is my code:
PREPARE-PRINTER-WITH-STANDARD-PRINTER-DIALOG.
CALL "P$SETDIALOG" USING PrintDialog.
CALL "P$DisplayDialog".
IF DIALOG-RETURN = 0
move SET-DEFAULT-PRINTER to default-option
move dpb-len of MyDefaultPrinterBrowser to dp-len
move dpb-body of MyDefaultPrinterBrowser(1:dp-len) o dp-body
call "PC_PRINTER_SET_DEFAULT" using by value default-option
by reference MyDefaultPrinter
PERFORM OPEN-PRINTER-PARA
END-IF.
What I would like to do is grab what was changed in the Windows Printer selection box, and have it print correctly from my printer. I found that there was a patch back in 2022 that fixed the issues I was having with this: https://portal.microfocus.com/s/article/KM000011471?language=en_US
But it does not tell me how to implement it. I know I need to send an "PC_PRINTER_DEFAULT_PROPERTIES" command to the printer before setting the "PC_PRINTER_SET_DEFAULT", but I am not sure how to grab the information I need. In RM COBOL we didn't need to do this - it just automatically did it.
Because of all of this - We had to create our own printer dialog box - and it is not working correctly either - In that program - Whenever I select to change the number of copies - it overrides the Paper Orientation that was set in the program and uses what the default is on the printer.