copy to netprinter

G

Guest

Hej
In VB or VBA I can send a string (containing special caracters for
generating a barcode label,eg ^XA,^FO140,^XZ etc) with a syntax like when the
printer is connected to LPT1:
MyString=^XA,^FO140,^XZ
Open LPT1 For Output As #1
Print #1, MyString
Close #1
I Have problems with a sending the same to fx "Zebra TLP 2844 on Ne00" (the
printercollection gives the devicename and port in VB)
Can somebody give a hint ??
Best regards
Leif Rasmussen
 
T

Tom Ogilvy

This is the form I have used previously and it worked for me:

I used the first part of the result of ActivePrinter when that printer was
selected.

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
 
G

Guest

Hej again
I dont understand "the first part of the result of ActivePrinter" I my
application ActivePrinter returns "Zebra TLP2844-Z on Ne04:" and if I write
Open "\\Zebra TLP2844-Z" for output As#1
I get an error. What have I not understud ???

Tom Ogilvy said:
This is the form I have used previously and it worked for me:

I used the first part of the result of ActivePrinter when that printer was
selected.

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

Leif Rasmussen said:
Hej
In VB or VBA I can send a string (containing special caracters for
generating a barcode label,eg ^XA,^FO140,^XZ etc) with a syntax like when the
printer is connected to LPT1:
MyString=^XA,^FO140,^XZ
Open LPT1 For Output As #1
Print #1, MyString
Close #1
I Have problems with a sending the same to fx "Zebra TLP 2844 on Ne00" (the
printercollection gives the devicename and port in VB)
Can somebody give a hint ??
Best regards
Leif Rasmussen
 
T

Tom Ogilvy

Perhaps it is just in the email and your code is correct, but
Open "\\Zebra TLP2844-Z" for output As#1

shows As#1 instead of As #1

My Activerpinter returned the \\ also, so what you are getting might be some
form of name rather than that actual address. You might need to find the
actual address of the printer - what I was telling you is that if you get an
equivalent network name, the command should work.

--
Regards,
Tom Ogilvy



Leif Rasmussen said:
Hej again
I dont understand "the first part of the result of ActivePrinter" I my
application ActivePrinter returns "Zebra TLP2844-Z on Ne04:" and if I write
Open "\\Zebra TLP2844-Z" for output As#1
I get an error. What have I not understud ???

Tom Ogilvy said:
This is the form I have used previously and it worked for me:

I used the first part of the result of ActivePrinter when that printer was
selected.

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

Hej
In VB or VBA I can send a string (containing special caracters for
generating a barcode label,eg ^XA,^FO140,^XZ etc) with a syntax like
when
the
printer is connected to LPT1:
MyString=^XA,^FO140,^XZ
Open LPT1 For Output As #1
Print #1, MyString
Close #1
I Have problems with a sending the same to fx "Zebra TLP 2844 on Ne00" (the
printercollection gives the devicename and port in VB)
Can somebody give a hint ??
Best regards
Leif Rasmussen
 

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