Sanmarie
asked on
Change Default Printer Settings in vb.net code
Using .Net 2.0, VS 2005, vb.net
I'm trying to print to a printer with setting defined in the attached vb.net code. The default settings of the printer is letter size with portrait orientation. I'm trying to print to legal size with landscape orientation but the attached code doesn't work. What am I doing wrong.
Thanks
San
I'm trying to print to a printer with setting defined in the attached vb.net code. The default settings of the printer is letter size with portrait orientation. I'm trying to print to legal size with landscape orientation but the attached code doesn't work. What am I doing wrong.
Thanks
San
Dim Printdoc As New Printing.PrintDocument
Dim SetPage As New System.Drawing.Printing.PageSettings
With SetPage
.PaperSource = PrintDoc.PrinterSettings.PaperSources(0)
.PaperSize.RawKind = Printing.PaperKind.Legal
.Landscape = True
End With
PrintDoc.DefaultPageSettings = SetPage
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Margajet24, it didn't work. It's still printing on letter size paper with portrait orientation.
San
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I will try your code on Monday when I return to work. Will respond soon ...
San