Solved

can't print form image to this type of printer in vb6

Posted on 2013-11-22
4
483 Views
Last Modified: 2013-11-22
I have the following vb6 code.

If MsgBox("This record has been saved.  Would you like to print?", vbYesNo Or vbQuestion, "Print Record") = vbYes Then
    Printer.Orientation = vbPRORLandscape
    frmRegistrationSYAB.PrintForm
    Printer.Orientation = vbPRORLandscape
    frmRegistrationSYAB2.PrintForm
End If

Open in new window



I get the error on line 5 "can't print form image to this type of printer"

Why is this happening?
0
Comment
Question by:al4629740
[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
4 Comments
 
LVL 47

Expert Comment

by:Martin Liss
ID: 39670797
What is your default printer?
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 500 total points
ID: 39670831
make a call to the Printer.EndDoc method after each PrintForm method call :

If MsgBox("This record has been saved.  Would you like to print?", vbYesNo Or vbQuestion, "Print Record") = vbYes Then
    Printer.Orientation = vbPRORLandscape
    frmRegistrationSYAB.PrintForm
    Printer.EndDoc
    Printer.Orientation = vbPRORLandscape
    frmRegistrationSYAB2.PrintForm
    Printer.EndDoc
End If

Open in new window


http://support.microsoft.com/kb/242483
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 39670837
Does the printer have the ability to print landscape?
0
 

Author Closing Comment

by:al4629740
ID: 39670920
That worked.  Thanks!
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…
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…

705 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