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
219 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
changeXy challenge 13 69
wordmultiple challenge 12 121
Tviruailstringtree sort multi columns on header click 1 54
iframe detection of parent window scale 20 61
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…
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 …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

863 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

18 Experts available now in Live!

Get 1:1 Help Now