Solved

Printing a text file

Posted on 1998-09-01
4
132 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

760 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

20 Experts available now in Live!

Get 1:1 Help Now