Article ID: 105878
Article Last Modified on 10/11/2006
Sub HP4_Paper_Source()
Application.Wait Now + Timevalue("00:00:01")
Application.ActivePrinter = "HP LaserJet 4/4M on LPT1:"
SendKeys "%(f)(p)(r)%(s)%(s){pgup}{down}{down}
{down}{down}~~~"
End Sub
In order to use this Macro with a shortcut key, you must put a wait
statement before the Application.ActivePrinter line. The wait may have to
be adjusted depending on the system environment. For example, to make the
macro wait one second, use the following line of code:
Application.Wait Now + Timevalue("00:00:01")
The following is an explanation of the string used in the SendKeys
function:
This command Performs this action
----------------------------------------------------
%(f)(p)(r) Chooses Printer Setup in the Print dialog
%(s) Chooses Setup in the Printer Setup dialog
%(s) Chooses Paper Source in the HP 4/4M Setup dialog
{pgup} Moves Paper Source selection up
{down} Moves Paper Source selection down
To set the paper source, and then set it back to Auto Select, use the
following code:
Sub HP4_Paper_Source()
Application.Wait Now + TimeValue("00:00:01")
Application.ActivePrinter = "HP LaserJet 4Si/4Si MX on LPT1:"
SendKeys "%(f)(p)(r)%(s)%(s){pgup}{down}{down}{down}{down}~~~"
Application.OnTime Now + TimeValue("00:00:08"), "setback"
' SendKeys "%(f)(p)(r)%(s)%(s){pgup}~~~"
End Sub
Sub setback()
Application.Wait Now + TimeValue("00:00:01")
Application.ActivePrinter = "HP LaserJet 4Si/4Si MX on LPT1:"
SendKeys "%(f)(p)(r)%(s)%(s){pgup}~~~"
End Sub
Additional query words: print XL5
Keywords: kbprogramming KB105878