-
July 31st, 2014, 02:43 AM
#1
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
-
July 31st, 2014, 12:58 PM
#2
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
-
August 8th, 2014, 02:57 AM
#3
Re: Changing printer papersize at runtime
We are trying to use this code for changing papersize to A4 befor printing report.
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
-
August 9th, 2014, 04:13 AM
#4
Re: Changing printer papersize at runtime
PaperSize=122? As far as I know custom form is 256. At least ?vbPRPSUser shows me 256.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
On-Demand Webinars (sponsored)
|