Global variable/Print

T

Terry V

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

Thanx
Terry
 
T

Tom Ogilvy

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
 
Top