We help IT Professionals succeed at work.
Get Started

In VBA, how do I use the "Open" command to print to a TCP/IP printer?

1,896 Views
Last Modified: 2013-11-27
I have a Zebra S4M network printer (Ethernet connection) on a Windows Server 2003 network where the users are running an Access 2007 application.
Because of problems with Access Reports and barcode fonts, I am having to send Zebra Programming Language (ZPL) commands directly to the printer to print some barcode labels.
In VBA I am using an "Open strPrinterName For Output As #intFreeFile" instruction to open the link to the printer, but am having a problem with the "strPrinterName" when the printer is a "TCP/IP" device with its own IP address.
I have tried the full printer name, the port name and the IP address but none of these have worked.
I have managed to get it to work by making the printer "shared" on a particular PC and used the syntax "\\PCName\ShareName", but presumably that PC needs to be switched on for this to work and this seems to defeat the purpose of having a truly networked printer.

The Zebra S4M printer has what they call a "Zebra Printserver" installed but I have not been able to see the name of that printserver anywhere?

Can anyone help with the naming of this printer for my VBA code so that I am not dependent on a "share" on a particular PC?

Many thanks.
Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE