Problem - I have several printers with different numbers of trays
(some 2, some 3) and they're diferent types they call their trays
different names.

I create print macros to print letter head (first page from top tray,
other pages from lower tray, then entire copy on white for file) until
now I've been creating print macros for each type of printer but it's
getting time consuming to amend them and visit each PC to load normal
on.

Any ideas how to write a print macro which can detect which printer
you're connected to and print leterheads?

Re: Print macro which automatically identifys default printer by Howard

Howard
Mon Sep 27 07:40:23 CDT 2004

You can test for the name of the ActivePrinter.

--
http://www.standards.com/; See Howard Kaikow's web site.
"Jules" <jules.farrell@james-chapman.co.uk> wrote in message
news:6362e0f2.0409270331.64ff4dd7@posting.google.com...
> Problem - I have several printers with different numbers of trays
> (some 2, some 3) and they're diferent types they call their trays
> different names.
>
> I create print macros to print letter head (first page from top tray,
> other pages from lower tray, then entire copy on white for file) until
> now I've been creating print macros for each type of printer but it's
> getting time consuming to amend them and visit each PC to load normal
> on.
>
> Any ideas how to write a print macro which can detect which printer
> you're connected to and print leterheads?



Re: Print macro which automatically identifys default printer by Jonathan

Jonathan
Mon Sep 27 07:56:45 CDT 2004


"Jules" <jules.farrell@james-chapman.co.uk> wrote in message
news:6362e0f2.0409270331.64ff4dd7@posting.google.com...
> Problem - I have several printers with different numbers of trays
> (some 2, some 3) and they're diferent types they call their trays
> different names.
>
> I create print macros to print letter head (first page from top tray,
> other pages from lower tray, then entire copy on white for file) until
> now I've been creating print macros for each type of printer but it's
> getting time consuming to amend them and visit each PC to load normal
> on.
>
> Any ideas how to write a print macro which can detect which printer
> you're connected to and print leterheads?

You can find the name of the current printer by reading the ActivePrinter
property.

You can find out which paper trays are available on that printer by the
means described in this article

Controlling the Printer from Word VBA
Part 1: Using VBA to Select the Paper Tray
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=101

You will find it easier to maintain and distribute macros if you don't use
normal.dot. Take a look at this article

Distributing macros to other users
http://word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup


Re: Print macro which automatically identifys default printer by jules

jules
Mon Oct 25 04:36:45 CDT 2004

Thanks for the reply, the print macros will be in an addin template,
leaving normal alone. But I got a problem with the macro for showing
active printers:-

But at the stage "Sub Printer_List3()" the line ... Public Declare
Function GPString Lib "kernel32.dll" Alias "GetProfileStringA" (ByVal
lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As
String, ByVal lpReturnedString As String, ByVal nSize As Long) As Long
... is highlighted and I get a Compile Error: only comments may appear
after End Sub, End Function oor End Property.

Any ideas?