|
-
Jun 16th, 2004, 07:53 AM
#1
Is this usage of With illegal?
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
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Jun 16th, 2004, 07:56 AM
#2
Frenzied Member
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
'Buzby'
Visual Basic Developer
"I'm moving to Theory. Everything works there."
-
Jun 16th, 2004, 07:57 AM
#3
Frenzied Member
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?
-----------------------------------------------
"The hall is rented,"
"the orchestra is engaged,"
"its now time to see if you can dance!"
Q, Q-Who, Star Trek The Next Generation
-----------------------------------------------
General Work day

-----------------------------------------------
DOS, Win 95, Win 98 SE, Win ME, Win NT 4.0 SP6a, Windows 2000 SP3, Window XP SP1, Windows 7, Windows 8/8.1, Windows 10, Office 97 Pro, Office 2000 Pro, Office 2010, Office 2013, Office 2016, Office 2019, Visual Basic 6 (SP5), SQL, Oracle
-
Jun 16th, 2004, 07:58 AM
#4
Hyperactive Member
Have you installed a printer ? There's no Printer.Print in my VB. The With is okay!
Tapan Bhanot,
CEO, Avis Software.
Website: www.avissoftware.com
-
Jun 16th, 2004, 07:59 AM
#5
Frenzied Member
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.
'Buzby'
Visual Basic Developer
"I'm moving to Theory. Everything works there."
-
Jun 16th, 2004, 08:00 AM
#6
Frenzied Member
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 !
'Buzby'
Visual Basic Developer
"I'm moving to Theory. Everything works there."
-
Jun 16th, 2004, 08:06 AM
#7
Originally posted by Buzby
It's just that the PRINTER object seems to have been written in someone's lunch hour
or maybe by someone having a joint...?
Well, at least I wasn't mistyping...
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Jun 16th, 2004, 07:04 PM
#8
The picture isn't missing
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)
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Jun 17th, 2004, 01:30 AM
#9
Hyperactive Member
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!
Tapan Bhanot,
CEO, Avis Software.
Website: www.avissoftware.com
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
|