Solved

Setting Printer Font for Dot Matrix printers

Posted on 1998-02-25
5
5,205 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month10 days, 5 hours left to enroll

624 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