Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 8th, 2005, 07:37 AM
The Jay The Jay is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 1 The Jay User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 39 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old August 8th, 2005, 09:47 AM
Darius Darius is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 108 Darius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 16 m 54 sec
Reputation Power: 5
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.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > I'm a VB virgin and I'm desperate for help!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT