Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How to send HP printer escape codes from Excel?

Trying to select tray 2 on an HP 1200N ink jet printer from a VBA so each
page prints using the correct tray. I know the <esc codes to send I just
don't know how to send them.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to send HP printer escape codes from Excel?


I think something along the lines of


Code:
--------------------

Sub PrintLine()
Dim hdlTxt As Long

hdlTxt = FreeFile
'// Open the LPT1 port or Name of printer
Open "LPT1" For Output As #hdlTxt

'// Print command OR TEXT
Print #1, "THIS IS A TEST"

'// Close LPT1 port
Close #hdlTxt

End Sub

--------------------


--
Ivan F Moala


------------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...fo&userid=1954
View this thread: http://www.excelforum.com/showthread...hreadid=556735

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How to send HP printer escape codes from Excel?

Ivan,
I am trying to use your code but I also am using a networked printer
identified as shown below and on PORT USB003. I tried using "USB003" for
"LPT1". It does not generate an error but nothing happens.

Application.ActivePrinter = "HP Business Inkjet 1200 Series on Ne02:"

Any other ideas

Thanks

"Ivan F Moala" wrote:


I think something along the lines of


Code:
--------------------

Sub PrintLine()
Dim hdlTxt As Long

hdlTxt = FreeFile
'// Open the LPT1 port or Name of printer
Open "LPT1" For Output As #hdlTxt

'// Print command OR TEXT
Print #1, "THIS IS A TEST"

'// Close LPT1 port
Close #hdlTxt

End Sub

--------------------


--
Ivan F Moala


------------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...fo&userid=1954
View this thread: http://www.excelforum.com/showthread...hreadid=556735


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How to send HP printer escape codes from Excel?

Ivan,
I am trying to use your code but I also am using a networked printer
identified as shown below and on PORT USB003. I tried using "USB003" for
"LPT1". It does not generate an error but nothing happens.

Application.ActivePrinter = "HP Business Inkjet 1200 Series on Ne02:"

Any other ideas

Thanks


"Ivan F Moala" wrote:


I think something along the lines of


Code:
--------------------

Sub PrintLine()
Dim hdlTxt As Long

hdlTxt = FreeFile
'// Open the LPT1 port or Name of printer
Open "LPT1" For Output As #hdlTxt

'// Print command OR TEXT
Print #1, "THIS IS A TEST"

'// Close LPT1 port
Close #hdlTxt

End Sub

--------------------


--
Ivan F Moala


------------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...fo&userid=1954
View this thread: http://www.excelforum.com/showthread...hreadid=556735


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
How do I send a spreadsheet to a printer outside the network? Moe in Goffstown Excel Discussion (Misc queries) 3 February 14th 07 04:34 PM
howto send host fonts to adobe pdf printer Abraham Andres Luna Excel Programming 3 March 7th 06 08:16 PM
Send printer escape commands to a printer using VBA mikeburg[_41_] Excel Programming 3 October 6th 05 07:36 PM
How to give escape sequence in Excel string literals... [email protected] Excel Programming 2 August 9th 05 07:38 AM
Need to Escape from Excel Forumla Hell! Julie P. Excel Worksheet Functions 3 April 29th 05 05:07 PM


All times are GMT +1. The time now is 09:32 AM.

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"