Printing an error report

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

Guest

I'd like to print a simple error report from the application to the default network printer without using a worksheet. The text is in a string.

Any ideas?
 
First, I went to the immediate window in the VBE to query the activeprinter
string

To a Network printer
? activePrinter
\\ARDAPS01\1D343E on Ne02:

then I used the first part in the below code:

Sub Macro5()
Dim ctrl As Long
Dim tmpstr As String
Open "\\ARDAPS01\1D343E" For Output As #1
Print #1, "[Start of Printing Test]"
For ctrl = 1 To 10
tmpstr = "Printing Line " + Str(ctrl)
Print #1, tmpstr
Next
tmpstr = "[End of printing test]" + Chr(12)
Print #1, tmpstr
Close #1
End Sub

Worked for me.

Regards,
Tom Ogilvy


Steve said:
I'd like to print a simple error report from the application to the
default network printer without using a worksheet. The text is in a string.
 
Back
Top