It's really really confusing... here are some samples... ignroe the
iPrinterType (this is something that I use specifically in the program. but
you actually have to check for the enumeration type and set it to that based
on the printers availiblity.
for Each papSource In _printDoc.PrinterSettings.PaperSources
If papSource.Kind = Printing.PaperSourceKind.AutomaticFeed Then
_printDoc.DefaultPageSettings.PaperSource = papSource
Exit For
End If
Next
If (iPrintertype = 0) Then
For Each papSize In _printDoc.PrinterSettings.PaperSizes
If papSize.Kind = Printing.PaperKind.Letter Then
_printDoc.DefaultPageSettings.PaperSize = papSize
Exit For
End If
Next
ElseIf (iPrintertype = 1) Then
For Each papSize In _printDoc.PrinterSettings.PaperSizes
If papSize.Kind = Printing.PaperKind.Ledger Or papSize.Kind =
Printing.PaperKind.Standard11x17 Then
_printDoc.DefaultPageSettings.PaperSize = papSize
Exit For
End If
Next
End If
"Fred Nelson" <fr**@smartybird.com> wrote in message
news:OY**************@TK2MSFTNGP09.phx.gbl...
Hi:
I'm trying to write a program that will print envelopes using a HP
Laserjet 4 that has three trays. In the future this program will work with other
printers so I don't want to "hard code" (or send raw output) to accomplish
this.
I'm trying to figure out how to set the PaperSource property and haven't
had any luck! I've searched MSDN and Google and can't find a single example.
If anyone knows how to do this I would GREATLY appreciate it - I've tried
everything!
Thanks,
Fred