Filter Paper Types in PageSetupDialog?

timh

Well-known member
Joined
Nov 28, 2008
Messages
50
Programming Experience
Beginner
Is it possible to "filter" the paper sizes available to select from in a PageSetupDialog?

I have a function to print an envelope and was hoping to be able to constrain the user to only select an envelope size (or custom one).

At the very least, it would be nice for the PageSetUpDialog "Paper Size" field to default to, say, DL Envelope. Can it be done? So far, I haven't found anything online on this topic.

Thanks.
 
I'm no expert in this area so don't take anything I say as definitive but I don't think that it is possible to filter that list. The information comes from the printer itself and is exposed in a read-only manner. Setting the default paper size may be possible though. Your PrintDocument has a PrinterSettings property and that has a PaperSizes property. You can get one of those values and assign it to the PaperSize property of the DefaultPageSettings property of the same PrintDocument.
 
Thanks for that.

I've tried playing around getting the printer settings, but I still can't seem to do what I want, so I think I'll leave it.

If anyone does have an answer, I would be interested to hear it though. There must be some way of achieving this. After all, if I go to the envelope print utility in Word, it will list envelope types only in the dialog box...albeit that's not a standard print dialog box. Maybe that's the answer? Creating my own print dialog box is probably beyond me though!
 
Back
Top