Entering escape codes for printing in Word 2003

E

Eric G

XPP SP2
Office 2003 SP2



Hello,

Is there anyone here that still remembers how to put in escape sequences into Word?

Many (many) years ago I did just that for the original LaserJet and the LaserJet II, but have totally forgotten what, or how I did it, and, unfortunately, I never kept the manuals.

I want to automate some functions in templates, eg select a specific printer tray (cassette) for printing when creating a new document on a template. The commands to be entered are normal PCL 5 command.

I think I know that you should use the Print field command, ie , and then just enter the escape sequence for the specific tray, like { Print 27"l2H } (Tray 1 in multi-sheet mode). I got the 27" from a MS Knowledgebase article (ID : 78652, intended for Word 97), but that is obviously not the right way to generate an escape code for Word 2003, since it doesn't work at all.

I guess this also could be achieved via a macro, but can you do an AutoRun macro, that only runs when you open a specific template?

Grateful for any ideas.

Best regards,


Eric G
Stockholm, Sweden
 
S

Suzanne S. Barnhill

If you don't get an answer here, try the experts in
microsoft.public.word.printingfonts.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

XPP SP2
Office 2003 SP2



Hello,

Is there anyone here that still remembers how to put in escape sequences
into Word?

Many (many) years ago I did just that for the original LaserJet and the
LaserJet II, but have totally forgotten what, or how I did it, and,
unfortunately, I never kept the manuals.

I want to automate some functions in templates, eg select a specific printer
tray (cassette) for printing when creating a new document on a template. The
commands to be entered are normal PCL 5 command.

I think I know that you should use the Print field command, ie , and then
just enter the escape sequence for the specific tray, like { Print 27"l2H }
(Tray 1 in multi-sheet mode). I got the 27" from a MS Knowledgebase article
(ID : 78652, intended for Word 97), but that is obviously not the right way
to generate an escape code for Word 2003, since it doesn't work at all.

I guess this also could be achieved via a macro, but can you do an AutoRun
macro, that only runs when you open a specific template?

Grateful for any ideas.

Best regards,


Eric G
Stockholm, Sweden
 
J

Jay Freedman

Hi Eric,

You can find a reference page for PCL5 codes at
http://pcl.to/reference. For your specific question, go to
http://pcl.to/reference/#pcl_paper_control.

Translating the codes shown on that page (which is the way you'd find
them in the HP PCL manual) to Word's Print field goes like this:

- The guide shows an "EC" symbol that represents the "Escape code".
This code has the decimal value 27, so that's the first thing in the
Print field following the keyword. Everything else in the field needs
to be enclosed in a pair of double quotes.

- The next character in all the paper-control codes and many others is
an ampersand (&). Other types of codes use a parenthesis or an
asterisk in this position.

- The code l2H corresponds to the manual feed tray. Other codes that
look useful are l1H for Tray 1 and l4H for Tray 2. (Be sure to use a
lower case ell before the number.)

So the complete Print field for manual feed should be

{ PRINT 27"&l2H" }

and the others are similar.

I'm not sure how a macro would be involved in this process, other than
to insert Print fields at specific places. I think it would be much
easier to put the field directly in the template where it's needed. To
satisfy your curiosity, though, it is possible to place an AutoNew
and/or an AutoOpen macro in a specific template, and the code runs
only when a document based on that template is opened.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
G

Graham Mayor

If your printer driver accepts PCL commands, you can use a PRINT field. A
PRINT field is simply a type of field that allows you to send instructions
directly to the printer.

Eg for duplex printing:

There are 3 possible data values for duplex setting: PRINT 27"&l0S" simplex
PRINT 27"&l1S" vertical duplex . PRINT 27"&l2S" horizontal duplex
(bookformat)

The codes after PRINT are 27 (escape), double quote, ampersand, lowercase L,
0, 1 or 2, uppercase S and finally terminated with a double quote.

Thus for horizontal duplex you would insert the following field :
{ PRINT 27"&l2S" }

Was the original Laserjet PCL5? HP's web site should be able to supply the
necessary command set - or you may find another reference at Google.


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

XPP SP2
Office 2003 SP2



Is there anyone here that still remembers how to put in escape sequences
into Word?
Many (many) years ago I did just that for the original LaserJet and the
LaserJet II, but have totally forgotten what, or how I did it, and,
unfortunately, I never kept the manuals.
I want to automate some functions in templates, eg select a specific
printer tray (cassette) for printing when creating a new document on a
template. The commands to be
entered are normal PCL 5 command.
I think I know that you should use the Print field command, ie , and then
just enter the escape sequence for the specific tray, like { Print 27"l2H }
(Tray 1 in multi-sheet
mode). I got the 27" from a MS Knowledgebase article (ID : 78652, intended
for Word 97), but that is obviously not the right way to generate an escape
code for Word 2003,
since it doesn't work at all.
I guess this also could be achieved via a macro, but can you do an AutoRun
macro, that only runs when you open a specific template?
 
E

Eric G

Jay,

Many thanks for your response.

Well, I though I was sort of right in my efforts when I put in the { PRINT
Print 27"l2H } command, to select the manual tray on the printer. But my
document still wouldn't print correctly to my printer, a Xerox Phaser
8550DX. I though something might be funny my printer, so I got up into my
attic to bring down an old (+/- 10 years in the attic) HP LaserJet 4 Plus. I
installed this printer, and it fired up without problems (that's quality)
and yes the print command, selecting bins and paper sizes, works like a
charm!

Consequently, it's the Phaser that's got some problem with the PCL command,
not the Print field command in Word. I've contacted Xerox about the problem
and trust that I'll hear from them within a day, or so. I'll post back the
solution if the problem is solved.

Once again, many thanks Jay for your input, it's much appreciated.

Best regards,


Eric G
Stockholm, Sweden
 
E

Eric G

Hello Graham,



Thanks for your reply. Nice hearing from you again.



As you can see in my response to Jay, I've pinned down the problem to my
printer, the Xerox Phaser 8550DX. I've also installed my old LaserJet 4 Plus
(10 years +, and more that 1 million copies), that's got what HP calls
"Enhanced PCL 5", ie PCL 5. This printer obeys any command given to it,
including complex nested PLC command.



On HP's site, I also found some 5 different PCL Technical reference manuals
that I found most useful as reference works.



Now I'm waiting for the Xerox support dept go get back to me, shouldn't take
to long, they've got quite good support.

I get back to the thread, if I get something positive out of Xerox.

Best regards,


Eric G
Stockholm, Sweden
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top