Solved

Printing in a matrix printer

Posted on 1998-07-24
3
345 Views
Last Modified: 2013-12-03
I am doing a report with de printer object in a matrix printer. This report is bigger than one page. I use fontsize 10 and font type courier, the first page is printed well. In the second page start the problem, it appears characters bigger than the space destinated to them. Then, the print has like a half of the line printed and continue witth the next half line that must be a complet line, and it follows until the end of the page.
I change the fontsize and font each time there is a new page.What is happening, and how I can solve my problem ?
Thank you
pd The printer is an Epson, and it has only few fonts like courier, orator, pica, etc.
Pepe
0
Comment
Question by:al361345
[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
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
kamall earned 200 total points
ID: 1466611
al361345, here is the answer:

Fix Printer Object Font/Paging Quirk
An ‘undocumented feature’ of the VB Printer Object requires that each new page be initialized before the font can be changed.
You would think that the following code would change the current font of the default printer in VB, but you’d be wrong:

    With Printer.Font
    .Name = "Arial"
    .Size = 11
    End With

    sText = "What a waste it is to lose one’s mind."
    Printer.Print sText


This code works as expected:

    ' Start new page
    Printer.Print
    With Printer
    ' Set margins as desired
    .ScaleMode = vbTwips
    .CurrentX = 720
    .CurrentY = 720
    ' Now you can set the font
    With .Font
    .Name = "Arial"
    .Size = 11
    End With

    End With

    sText = "If we don’t succeed, we run the risk of failure."
    Printer.Print sText
    Printer.EndDoc

You MUST initialize each new page using similar code.

Best regards.
0
 

Author Comment

by:al361345
ID: 1466612
Thanks, kamall. I have now another problem. I already wrote my question on the discussion group.
Thank you again.
Pepe
0
 
LVL 7

Expert Comment

by:kamall
ID: 1466613
You are welcome Pepe.
I will check you new question and see if I can help.
Best regards.
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

Suggested Solutions

Title # Comments Views Activity
Search combo error "Data Type Mismatch in Criteria Expression" 2 94
Help me. 3 77
Problem to line 23 79
can this macro be converted to sub procedure 4 33
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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

737 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