Solved

why must i quit vb program only then the printer will start printing and how to make vb program start with 640 X 480 resolution no matter what current pc display configuration is?

Posted on 2004-08-12
4
246 Views
Last Modified: 2010-04-17
why must i quit vb program only then the printer will start printing and
how to make vb program start with 640 X 480 resolution no matter what current pc display configuration is?

here is my printing code

Private Sub Command1_Click()
Dim mcount As Integer

mcount = 0

Do While True
   If mcount >= 2 Then

   Exit Sub
   End If

   Printer.Print
   Printer.Print Space(15); "Company Name" + Space(19) + "No."
   Printer.FontName = "Arial"
   Printer.FontSize = 20
   Printer.Print Space(15); "address"
   Printer.Print ; Space(15); "address1   "
   Printer.Print Space(15); "; address; 2; """
   Printer.Print Space(15); "telno & faxno"
   Printer.FontName = "arial"
   Printer.FontSize = 12
   Print
   If mcount >= 1 Then
     Printer.Print "                                                                                            *ACCOUNT'S COPY*"
   Else
      Printer.Print
   End If
   Printer.Print

   Printer.Print Space(15); "YOUR REFERENCE    : "
   Printer.Print " "
   Printer.Print Space(15); "FILE ACCOUNT NO   : "
   Printer.Print " "
   Printer.Print Space(15); "FILE REFERENCE NO : "
   Printer.Print " "
   If Len(mswhopay2) >= 30 Then
      Printer.Print Space(15); "RECEIVED FROM  "
      Printer.Print "               "
   Else
      Printer.Print Space(15); "RECEIVED FROM  "
      Printer.Print
   End If
 
   Printer.Print Space(15); "BEING PAYMENT  "
   Printer.Print Space(15); "               "
   Printer.Print Space(15);
   Printer.Print Space(15);
   Printer.Print Space(15);
   mcount = mcount + 1

Loop

End Sub


thanks..
0
Comment
Question by:tancy1
  • 3
4 Comments
 
LVL 6

Expert Comment

by:parkerig
ID: 11790103
Hi,
You need to add

Printer.EndDoc



Cheers
Ian
0
 
LVL 6

Expert Comment

by:parkerig
ID: 11790133
On screen resolution have a look at these URLs

http://www.thescarms.com/vbasic/chgres.asp

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=175&lngWId=1          ( READ the comments from others on this one )

http://www.freevbcode.com/ShowCode.asp?ID=3873

http://www.freevbcode.com/ShowCode.asp?ID=467


Most examples are putting into 800 * 600 so you will need to adjust

Cheers.
0
 

Author Comment

by:tancy1
ID: 11798301
still having the printing problem. i have to quit all the open windows only the printer will start printing. where shall i insert printer.enddoc?
0
 
LVL 6

Accepted Solution

by:
parkerig earned 40 total points
ID: 11798688
At a glance,


Do While True
   If mcount >= 2 Then
     printer.endoc
     Exit Sub
   End If

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Full Screen problem when auto scale IFRAME 2 120
Please help| Getting the syntax error in below query. 2 70
printf performancy 11 84
incorrect syntax near the order by 10 56
This article will show, step by step, how to integrate R code into a R Sweave document
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…

735 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