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
253 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
[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
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this post we will learn different types of Android Layout and some basics of an Android App.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Progress

691 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