Solved

Printing a text file

Posted on 1998-09-01
4
133 Views
Last Modified: 2012-05-04
How can I send to the printer a text file?
There is a command or a function to print a file?
0
Comment
Question by:feramet
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
waty earned 20 total points
ID: 1432300
Printer.Print "Your Text"
Printer.EndDocument


' *** Open the SGML file
nSgmlIn = FreeFile
Open sSgmlCurrent For Input Access Read As #nSgmlIn
sSgmlIn = ""
Do While EOF(nSgmlIn) = False
   Line Input #nSgmlIn, sTmp
   printer.print stmp
Loop
Close #nSgmlIn

Printer.EndDocument

0
 
LVL 14

Expert Comment

by:waty
ID: 1432301
NB: I forgot to tell you to manage the skip to new pages.

Do as follow :

nMageHeight = Printer.Height - Printer.ScaleHeight

' *** Open the file
nSgmlIn = FreeFile
Open sSgmlCurrent For Input Access Read As #nSgmlIn
Do While EOF(nSgmlIn) = False
   Line Input #nSgmlIn, sTmp

   If Printer.CurrentY > Printer.Height - nMageHeight then
      Printer.NewPage
   End If

   printer.print stmp
Loop
Close #nSgmlIn

Printer.EndDocument


0
 

Author Comment

by:feramet
ID: 1432302
thanks!!!
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1432303
Bought This Question.
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
VBA: Add rows to listbox based on criteria 7 73
Problem to skip loop 6 55
vb script Microsoft Word tables portion of based on bookmark, count and add rows 1 48
vbModal 12 34
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

910 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

24 Experts available now in Live!

Get 1:1 Help Now