|
-
Nov 9th, 2000, 11:13 AM
#1
Thread Starter
Addicted Member
God I hate to admit it but I don't know how to print files in VB !
I use the common dialog to set everything the user wants but I don't find anything to launch the printing sequence...
Please feel sorry for me not knowing this and help me out
:-)
-
Nov 9th, 2000, 11:19 AM
#2
Fanatic Member
Do something like this:
Code:
Printer.Print "Hello World! :-)"
Printer.EndDoc
-
Nov 9th, 2000, 11:23 AM
#3
PowerPoster
*Vince
It really depends on what you want to print:
I use VB Printer.print alot. This allow you to place data on a a page using x, y coordinates which, does ttake more time, but for me, it's not a problem.
People have suggested buying Crystal Reports or other 3rd Party, but, right now, b's Printer.print does the job for me.
You can use a for loop to print multiple pages, too.
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Nov 9th, 2000, 11:27 AM
#4
Fanatic Member
The Printer object works just like a picture box. It also has property's like CurrentX and CurrentY.
-
Nov 9th, 2000, 11:27 AM
#5
Thread Starter
Addicted Member
Thanks guys but I don't want to open the file and read it all to send it to the printer, I want to send the file to the printer that's it ! Is there a way to do so ?
-
Nov 9th, 2000, 11:30 AM
#6
Fanatic Member
No, but you can do it in code like this:
Code:
'read the file line by line and sent the output
'to the printer
Dim oneLine As String 'one line in the file
'open the file
Open "C:\Myfile.txt" For Input As #1
'loop through all the lines
Do
'read a line
Line Input #1,oneLine
'print the line
Printer.Print oneLine
Loop Until Eof(1)
'say that the printing has ended
Printer.EndDoc
'close the file
Close #1
-
Nov 9th, 2000, 11:59 AM
#7
Member
try using office
If you have office on your machine, and the file is not strickly a test file, i would try using a word object... send the information you want to word and then use that to print it out... its nice becase you can also use it for print previews and jazz like that... just a suggestion.
U S A
Visual Studio .NET
Windows XP
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
|