Changing printer papersize at runtime
Hi,
We are using a application which needs to print 2 types of documents. one is A4 and another one is custom made which has width lesser than A4. So we need to automatically change the papersize at runtime. How we can do that?? Please help.
Thank you
Re: Changing printer papersize at runtime
<printer.papersize=vbprpsa4> or <printer.papersize=vbprpsa3> 'or http://msdn.microsoft.com/en-us/libr...papersize.aspx
<printer.orientation=1> '1=portrait 2=landscape
Re: Changing printer papersize at runtime
We are trying to use this code for changing papersize to A4 befor printing report.
Quote:
Dim x1 As Printer
For Each x1 In Printers
If x1.DeviceName = Printer.DeviceName Then
Set printer as system default.
Set Printer = x1
Stop looking for a printer.
Exit For
End If
Next
Printer.PaperSize = 9 'for changing to A4 papersize
report1.Show vbModal
report2.Show vbModal
Printer.PaperSize = 122 'for changing to custom papersize
But its not working. It still says report width is higher. If we manually change papersize to A4 then no problem at all. Why is this code not working?? please help
Re: Changing printer papersize at runtime
PaperSize=122? As far as I know custom form is 256. At least ?vbPRPSUser shows me 256.