Link to home
Start Free TrialLog in
Avatar of feramet
feramet

asked on

Printing a text file

How can I send to the printer a text file?
There is a command or a function to print a file?
ASKER CERTIFIED SOLUTION
Avatar of waty
waty
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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


Avatar of feramet
feramet

ASKER

thanks!!!
Bought This Question.