Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default copy to netprinter

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default copy to netprinter

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" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default copy to netprinter

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" wrote:

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" wrote in message
...
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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default copy to netprinter

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" wrote in message
...
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" wrote:

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" wrote in

message
...
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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
copy formulas from a contiguous range to a safe place and copy them back later Lucas Budlong Excel Programming 2 February 22nd 06 08:26 PM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Excel Programming 1 April 15th 04 08:34 PM


All times are GMT +1. The time now is 01:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"