PrinterSetup - Number of copies

Has anyone found way of changing the default ‘Number of Copies’ in the Windows printersetup dialogue box? In my application I want to change the default number of copies for some prints, but still allow the user to override this.

It’s not possible in the standard framework which is why I’ve asked for access into the printing workflow <https://xojo.com/issue/51559>.

The only way around this at the moment is to completely rewrite the printing workflow using declares, which I haven’t got around to doing yet.

You can edit the setup string with WindowsDeviceModeMBS class in MBS Xojo Win Plugin.
e.g. change copies value there. Then use OpenPrinter() without dialog…

This peaked my interest Christian, I tried the Print To Printer demo in 19.2 and added d.Copies = 2 after the commented out “enable duplex” section but 2 copies weren’t printed, only 1. I then tried it to a different printer to make sure it wasn’t a printer issue and the program crashed :frowning:

did you set the flag that copies is set?
Also print setup may be printed related.

Ah nice thanks, I found the flag, thanks, that’s printed 2 to my label printer but still crashed going to my laser.

It would be nice if the documentation mentioned to use the Fields property as I went straight to Copies in the docs and didn’t even know that Fields had to also be set when changing the Copies :slight_smile: