|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm a VB virgin and I'm desperate for help!
I've just read a "Learn VB in 24 hours" books and I'm trying to get VB to print for me. I want to print from a file without opening it or viewing it. I want to be able to click a button that will display a Message Box to ask for confirmation and then send the correct info to the printer for printing. This is the first time I've ever used VB and would love to start using it frequently so if anyone can give me a helping hand I would greatly appreciate it. I hope to hear from someone soon. Cheers, The Jay |
|
#2
|
|||
|
|||
|
Something like that
Code:
Private Sub Command1_Click()
to_printer = MsgBox("Do you want to send the file to printer", vbQuestion + vbOKCancel, "Printing confirmation")
If to_printer = 1 Then
Shell Environ("ComSpec") & " /c type c:\aaa.txt>lpt1"
End If
End Sub
It's not the normal way to do it but you didn't gave much options. The name and path must be yours. The file must be in text format and the printer connected to lpt1 port. You can still change lpt1 to the route to the network printer. ![]() |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > I'm a VB virgin and I'm desperate for help! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|