Global variable/Print

  • Thread starter Thread starter Terry V
  • Start date Start date
T

Terry V

Hello
How do I print the contents of a global variable to the default printer?

Thanx
Terry
 
Sub Macro5()
Dim ctrl as Long
Dim tmpstr as String
Open "LPT1:" For Output As #1
Print #1, "[Start of Printing Test]"
For ctrl = 1 To 10
tmpstr = "Printing Line " & cStr(ctrl)
Print #1, tmpstr
Next
tmpstr = "[End of printing test]" & Chr(12)
Print #1, tmpstr
Close #1
End Sub


Worked for me. May have to change LPT1 to address your printer.

You will have to workout how to address your printer.

Regards,
Tom Ogilvy
 

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