Specify network printer in Open for Output method?

E

Ed

My apologies for double-posting - I inadvertently put this in the
general Excel group first.

Right now I have
Open "LPT1:" For Output As #1
But I can't use my LPT1 printer at the moment. Is there a way I can
specify a networked printer?

Ed
 
T

Tom Ogilvy

Substitute the network name for LPT1

as an example, this worked for me in the past:

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
 
E

Ed

Hi, Tom. Thanks much - I will give this a try.

Ed

Substitute the network name for LPT1

as an example, this worked for me in the past:

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

--
Regards,
Tom Ogilvy



Ed said:
My apologies for double-posting - I inadvertently put this in the
general Excel group first.
Right now I have
Open "LPT1:" For Output As #1
But I can't use my LPT1 printer at the moment. Is there a way I can
specify a networked printer?
Ed- Hide quoted text -

- Show quoted text -
 

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

Top