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.
 
Back
Top