Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy and paste versus copy and insert copied cells | New Users to Excel | |||
Copy/Paste how to avoid the copy of formula cells w/o calc values | Excel Discussion (Misc queries) | |||
copy formulas from a contiguous range to a safe place and copy them back later | Excel Programming | |||
EXCEL FILE a copy/a copy/a copy ....filename | New Users to Excel | |||
Code to copy range vs Copy Entire Worksheet - can't figure it out | Excel Programming |