Solved

Printing a text file

Posted on 1998-09-01
4
135 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 AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel object stays open 19 74
VBA Word macro - how to get characters after the searched for string 5 84
Windows 10 start screen issues 9 54
How to Add / Edit Windows Menu 4 60
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…

770 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