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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

828 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