I'm getting an error at the .Print line. Is this illegal at all or does it require a different syntax?
With Printer
.Print whatever
End With
Printable View
I'm getting an error at the .Print line. Is this illegal at all or does it require a different syntax?
With Printer
.Print whatever
End With
You'll notice that the .PRINT method of PRINTER doesn't appear in intellisense either..
What you are getting is a compiler error - the compiler doesn't know about the .PRINT method so it reckons it can't deal with it.
Other methods (like .ENDDOC etc) work fine.
However, if the compiler were to ignore the error and continue it would find that it would work after all.
Unfortunately, as far as I know, you can't tell the compiler to ignore errors so you will just have to do
With Printer
Printer.Print "hello"
.EndDoc
End With
use F1,
Printer is that a variable/interger
whats the whatever bit going to be just a tag?
if you want to print, then depends where, think .print, prints on the form itself?
Have you installed a printer ? There's no Printer.Print in my VB. The With is okay!
Robbo, PRINTER is a VB object for talking to the printer - in the same way as SCREEN is for talking to the screen.
It's just that the PRINTER object seems to have been written in someone's lunch hour and the .PRINT method isn't exposed in the intellisense so it doesn't work within WITH commands.
AvisSoft, just because it doesn't appear in the intellisense drop-down it doesn't mean it doesn't exist.
In VB4 we had to write code without intellisense - boy was that fun trying to discover the properties, methods and events of objects !
:D or maybe by someone having a joint...?Quote:
Originally posted by Buzby
It's just that the PRINTER object seems to have been written in someone's lunch hour
Well, at least I wasn't mistyping...
It also doesn't work with the Print method of the forn, picturebox, and any other controls that has that thing.
and Robbo, that is a HUGE signature... maybe you can trim it down a bit? (I mean it should be less than 10 lines)
Hi!
yes i understand. as far as i have seen the most complex thing in vb is printing. graphics, database, programming, winsock..all other stuff is easy...just printing is a pain...i hope one day this problem will also be solved.
instead of using 3rd party reporting tools there's should be something which is in the vb itself. i don't know weather .net has something or not...but as far as i am concerned crystal reports sucks!
thanks!