Solved

Setting Printer Font for Dot Matrix printers

Posted on 1998-02-25
5
4,502 Views
Last Modified: 2013-12-03
I would like to know how I can set the printer fonts prior to printing via the Dot Matrix printer.
What happen is when I have changed the fonts to Courier New and print via my HP Laser printer, the
document will be printed with Courier New font. But when I sent the same document to the Dot Matrix printer, it will be printed with the Dot Matrix default font and not Courier New.

The printing is done the Printer object. Any idea why? I know it is not because the printer Dot Matrix does not support Courier New font since I have tested printing a document using WordPad and the comes out as Courier New fonts.
0
Comment
Question by:wsm
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:mrmick
ID: 1457894
Try this,

Printer.FontName = "Arial"
Printer.Print " "
Printer.FontName = "Courier New"
' Note - you may have to repeat this for each new page.  This code can also be left as is for the HP printer.
0
 
LVL 8

Accepted Solution

by:
mrmick earned 100 total points
ID: 1457895
Whoops, I meant to offer that as the answer.
0
 

Author Comment

by:wsm
ID: 1457896
What I had set it this

gFontName = "Courier New"
TextLine = "Testing printing to local printer."

Printer.FontName = gFontName
Printer.NewPage
Printer.Print
Printer.Print TextLine
Printer.EndDoc

This codes works for Laser Printer as I would be able to see the
text being printed as Courier New. BUT if I print via the Dot
Matrix printer, it will not give me the font Courier New. instead
it prints out the text using the default font. However, if I use
WordPad application to print out the document and setting the
font to Courier New, it will come out nicely as Courier New at
the Dot Matrix.
0
 

Author Comment

by:wsm
ID: 1457897
What I had set it this

gFontName = "Courier New"
TextLine = "Testing printing to local printer."

Printer.FontName = gFontName
Printer.NewPage
Printer.Print
Printer.Print TextLine
Printer.EndDoc

This codes works for Laser Printer as I would be able to see the
text being printed as Courier New. BUT if I print via the Dot
Matrix printer, it will not give me the font Courier New. instead
it prints out the text using the default font. However, if I use
WordPad application to print out the document and setting the
font to Courier New, it will come out nicely as Courier New at
the Dot Matrix. Any reason why VB 4.0 (32-bit) is having this
problem with setting font before printing to Dot Matrix printer?
0
 
LVL 8

Expert Comment

by:mrmick
ID: 1457898
Yes, it's a bug.  Try what I suggested.

Printer.FontName = "Arial"
Printer.Print " "
Printer.FontName = "Courier New"
Printer.Print "This text should be in a Courier New font for both printers."


0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now