Solved

Printing a text file

Posted on 1998-09-01
4
138 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSRS expression Issue finding a string 10 102
I need help formating a date variable in my VB.Net application 2 68
How does CurrentUser work? 10 42
backup program with robocopy 6 75
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…
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…
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…

730 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