Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to print in VB5 ?

Posted on 1998-10-14
6
Medium Priority
?
326 Views
Last Modified: 2008-02-26
I have a serial printer EPSON TM-T88M. How can I print to the printer? Plese give me some sample code.
0
Comment
Question by:anik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 

Expert Comment

by:Haho2
ID: 1440004
regardless of whatever printer u have, as long as Win95 detects and supports your driver/s , you can print to the printer.
It is very simple...  
 --> printer.print  string ( or bitmap)

such as printer.print "Hello"
or printer.print "bunny.gif"

aslo look at EndDoc, KillDoc...

but the drawback to printing text is that it prints one line of text each time..
meaning that if u want to print a document, you must read it line byline and print each line.
  If u want to let the user choose Printer properties, use Commondialog and then call the Showprinter dialog...

 
0
 

Author Comment

by:anik
ID: 1440005
OK I tried it but I don't want the user to select a printer. How can I specify the default printer ?

Also I tried
printer.print "c:\aaa.bmp"
It just print out the line say c:\aaa.bmp. Not picture !

0
 
LVL 2

Accepted Solution

by:
dabellei earned 20 total points
ID: 1440006
By default VB will use the default printer without any action from the user.

You can't send a command like printer.print "c:\aaa.bmp"  

printer.print will print the text inside the quote not the content of the file.

If you want to print a text file you'll have to open it before and then read it line by line and print it line by line using printer.print.

To print a .bmp file it's different as you would have to use API function (HDC...) to print a bitmap or any file containing graphic stuff in it.

Is your question is how to print graphic file or text file?

For a text file i can send you a program (code sample) on how to do it, but for graphic it's little more complicated and take more time for that (and point maybe...) if you want a text example just leave a comment (don't reject the answer) i'll send you one.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:anik
ID: 1440007
OK send me the file. Do you also have printing graphics example? I will increase point to 50 for graphics printing.
0
 
LVL 2

Expert Comment

by:dabellei
ID: 1440008
What's your email?

0
 

Author Comment

by:anik
ID: 1440009
akarapol@bigfoot.com
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question