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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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 fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

747 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

16 Experts available now in Live!

Get 1:1 Help Now