Dim myPrintDocument As New System.Drawing.Printing.PrintDocument myPrintDocument.PrinterSettings.FromPage = 1 myPrintDocument.PrinterSettings.ToPage = 1 'print in Portrait mode myPrintDocument.PrinterSettings.DefaultPageSettings.Landscape = False 'set the paper source myPrintDocument.DefaultPageSettings.PaperSource = CType(Me.cboPaperTrayLetter.Text.Trim, PaperSource) 'print the envelope Me.txtTemplate.Print(myPrintDocument)... The problem is that the code:
CType(Me.cboPaperTrayLetter.Text.Trim, PaperSource)... doesn't work - I get a message saying that "Value of type 'String' cannot be converted to System.Drawing.Printing.PaperSource"