Solved

Setting Printer Font for Dot Matrix printers

Posted on 1998-02-25
5
4,987 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
[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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

751 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