Solved

Printing in a matrix printer

Posted on 1998-07-24
3
340 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
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
kamall earned 200 total points
Comment Utility
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
Comment Utility
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
Comment Utility
You are welcome Pepe.
I will check you new question and see if I can help.
Best regards.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

763 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

12 Experts available now in Live!

Get 1:1 Help Now