Papersize problem

Gardener
09-03-2003, 11:36 AM
I've been doing my nut all day with this, I'm probably missing something obvious but I can't solve it.

My computer is on winXP and my printer is a Canon BJC 4000

In my vb program the statements below all cause improper value error
printer.papersize = vbPRPSA5
printer.papersize = 11
printer.papersize = vbPRPSUser
printer.papersize = 256

In fact the only ones it will work for are A4, letter B5 and the other sizes that
show up as being available in the control panel printer properties.

In MS Word I can specify a custom size of 148mm X 210mm (ie A5)
but not in Visual Basic.

The same printer on a Windows98 machine offers a far wider selection of papersizes in the control panel including A5 and custom sizes.

Another peculiarity is the effect the following code has

printer.height = 210 * 56.7
printer.width = 148 * 56.7

has absolutely no effect on the papersize ie it still prints A4 size if thats what the printer is already set to, it doesn't cause an error either, in fact the only effect i have been able to find is that if you follow the above code with:
msgbox(printer.papersize) you get 256, ie custom but the printer still prints in A4.

Tell me how I'm being dumb please!!!!!!!

Thinker
09-03-2003, 03:57 PM
There are all sorts of things in NT-based versions of windows that you
can't do with the Printer object directly. You can take a look at the
standard bas module I attached here...
http://www.visualbasicforum.com/showthread.php?t=37443
It gives you more control (but still not perfect).

Gardener
09-03-2003, 04:17 PM
Thanks for that Thinker. I've downloaded your module but it'll take me a bit of time to understand what it does.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum