Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send a single line to the default printer

Status
Not open for further replies.

GVF

Programmer
Feb 25, 2005
160
US
Someone helped me out with this a while ago. I had a senior moment and lost the code.

I want to send a single line to the printer and have it wait patiently for the next line. When it gets to the bottom of the page it should eject the page and be ready for more data.

Something like:
print myString & vbCR

Greg
 
Working in Excel.
Wait for the next string to be sent.

If the printer is connected to LPT1 this works...

Open "LPT1:" for OutPut as #1
Print #1, MyString

then later
Print #1, Chr(12) 'to eject the last sheet
Close #1

The snippet I lost used an old VB command that I guess is still supported. I can't remember what it was.

My problem is with USB printers. I can use the Open statement if I can determine the port name for the USB port. ActivePrinter might say "HP 7550 on Ne00:" but "Ne00" does not open with the Open statement. In device manager I see that the port name is actually "DOT4_001" which will open. So I guess my question really is How do I get the port name for the default printer when it is a USB printer.

Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top