send text to printer

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I send data stored in a string variable directly to the printer?
How do I send a .txt file to the printer?
 
You can send a text file to the default printer by shelling to Notepad,
something like this:

Dim strCmd as String
Dim strFileSpec As String

strFileSpec = "D:\Folder\Text file.txt"

strCmd = Environ("SystemRoot") & "\System32\Notepad.exe /p """ _
& strFileSpec & """"

Shell strCmd

After that things get more complicated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top