Results 1 to 2 of 2

Thread: Sending text file to printer in vb

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    Mobile, AL
    Posts
    16

    Post

    Can you send an entire text file to the printer, or do you have to read the file and send it line by line?

    Thanks,
    Abby

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Post

    You can send the entire file to the printer.
    Code:
    Dim iFile%, sText$
    iFile = FreeFile
    Open "c:\MyFile.txt" For Input As #iFile
    sText = Input(LOF(iFile), iFile)
    Close #iFile
    Printer.Print sText
    Printer.EndDoc
    An other way is to shell Notepad to do the job for you:
    Code:
    Call Shell("Notepad.exe /p c:\MyFile.txt", vbHide)
    Good luck!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width