Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
ThomasAJ ThomasAJ is offline
external usenet poster
 
Posts: 21
Default How to make a document 'remember' which printer.

We have many printers. How do I make a document remember which printer it
should use when the print icon is clicked on.

Sure I can use the printer drop-down box but I want certain documents to
remember their own 'default printer'.
--
Regards
Tom
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to make a document 'remember' which printer.

The required printer is not something stored with the document. You can
intercept the print commands in the documents' templates to address the
required printers, and you could do so in the documents themselves, but that
would raise macro security issues - see
http://www.gmayor.com/fax_from_word.htm for some examples.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



ThomasAJ wrote:
We have many printers. How do I make a document remember which
printer it should use when the print icon is clicked on.

Sure I can use the printer drop-down box but I want certain documents
to remember their own 'default printer'.



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Bob Buckland ?:-\) Bob   Buckland ?:-\) is offline
external usenet poster
 
Posts: 2,073
Default How to make a document 'remember' which printer.

Hi Graham,

One method that I think Cindy(?) was using was to store the printer name in a custom document property then look for it in a macro.

If it doesn't already do so, couldn't the printer toolbar type macro in your examples include looking for that property and if it
found in the document property a name that matched a printer (or an array of choices that equalled a printer) then go on to
'suggest'/highlight the 'normally' selected printer (and also variables for trays?) for that document on that toolbar?

That would seem to avoid having a macro in a document and also wouldn't affect others who did not run the toolbar macro?

=================
"Graham Mayor" wrote in message ...
The required printer is not something stored with the document. You can
intercept the print commands in the documents' templates to address the
required printers, and you could do so in the documents themselves, but that
would raise macro security issues - see
http://www.gmayor.com/fax_from_word.htm for some examples.

--

Graham Mayor - Word MVP
--

Bob Buckland ?:-)
MS Office System Products MVP

*Courtesy is not expensive and can pay big dividends*


  #5   Report Post  
Posted to microsoft.public.word.docmanagement
ThomasAJ ThomasAJ is offline
external usenet poster
 
Posts: 21
Default How to make a document 'remember' which printer.


You cannot do this. If each document "remembered" a specific printer, it
would cause problems when the document went to another person.


Rubbish! If 'remembered' printer is not present then Word would use the
default printer. It might be called a 'Preferred Printer' and reside in
OPTIONS. A 5 minute programming exercise is all it would have taken.

OK so make that 10 minutes of coding.

Very disappointing ommision by MS.

I've been coding since about '75 so I know what I am talking about.
--
Regards
Tom


"Peter A" wrote:

In article ,
says...
We have many printers. How do I make a document remember which printer it
should use when the print icon is clicked on.

Sure I can use the printer drop-down box but I want certain documents to
remember their own 'default printer'.


You cannot do this. If each document "remembered" a specific printer, it
would cause problems when the document went to another person.

--
Peter Aitken
Author, MS Word for Medical and Technical Writers
www.tech-word.com



  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to make a document 'remember' which printer.

I would have thought that such an experienced coder would have been able to
arrange something suitable and saved me the bother, but the following macro
in the document template (or at a pinch in the document itself - though that
raises the spectre of macro security) will do the job. The macro intercepts
the print button and looks for the string "COLOR" in the available printers
(converting to printer names to upper case) . You can change that string to
match the printer you require for the document.

Sub FilePrintDefault()
Dim StrPrinters As Variant, i As Long
Dim sPrinter As String
Dim sNone As String
StrPrinters = ListPrinters
sPrinter = ActivePrinter
If IsBounded(StrPrinters) Then
For i = LBound(StrPrinters) To UBound(StrPrinters)
If InStr(UCase(StrPrinters(i)), "COLOR") Then
ActivePrinter = StrPrinters(i)
GoTo PrintDoc
End If
Next i
sNone = MsgBox("Required printer not available" & vbCr & vbCr & _
"Print to default Word printer?", vbYesNo, "Printer
Error")
If sNone vbYes Then
MsgBox "Print cancelled"
ActivePrinter = sPrinter
Exit Sub
Else
GoTo PrintDoc
End If
Else
MsgBox "No printers found"
End If
Exit Sub
PrintDoc:
MsgBox "Printing to " & ActivePrinter
ActiveDocument.PrintOut
ActivePrinter = sPrinter
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



ThomasAJ wrote:
You cannot do this. If each document "remembered" a specific
printer, it would cause problems when the document went to another
person.


Rubbish! If 'remembered' printer is not present then Word would use
the default printer. It might be called a 'Preferred Printer' and
reside in OPTIONS. A 5 minute programming exercise is all it would
have taken.

OK so make that 10 minutes of coding.

Very disappointing ommision by MS.

I've been coding since about '75 so I know what I am talking about.

In article ,
says...
We have many printers. How do I make a document remember which
printer it should use when the print icon is clicked on.

Sure I can use the printer drop-down box but I want certain
documents to remember their own 'default printer'.


You cannot do this. If each document "remembered" a specific
printer, it would cause problems when the document went to another
person.

--
Peter Aitken
Author, MS Word for Medical and Technical Writers
www.tech-word.com



  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to make a document 'remember' which printer.

It would of course have helped had I posted that you can get the
Listprinters routine from
http://word.mvps.org/FAQs/MacrosVBA/...lePrinters.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Graham Mayor wrote:
I would have thought that such an experienced coder would have been
able to arrange something suitable and saved me the bother, but the
following macro in the document template (or at a pinch in the
document itself - though that raises the spectre of macro security)
will do the job. The macro intercepts the print button and looks for
the string "COLOR" in the available printers (converting to printer
names to upper case) . You can change that string to match the
printer you require for the document.
Sub FilePrintDefault()
Dim StrPrinters As Variant, i As Long
Dim sPrinter As String
Dim sNone As String
StrPrinters = ListPrinters
sPrinter = ActivePrinter
If IsBounded(StrPrinters) Then
For i = LBound(StrPrinters) To UBound(StrPrinters)
If InStr(UCase(StrPrinters(i)), "COLOR") Then
ActivePrinter = StrPrinters(i)
GoTo PrintDoc
End If
Next i
sNone = MsgBox("Required printer not available" & vbCr & vbCr & _
"Print to default Word printer?", vbYesNo, "Printer
Error")
If sNone vbYes Then
MsgBox "Print cancelled"
ActivePrinter = sPrinter
Exit Sub
Else
GoTo PrintDoc
End If
Else
MsgBox "No printers found"
End If
Exit Sub
PrintDoc:
MsgBox "Printing to " & ActivePrinter
ActiveDocument.PrintOut
ActivePrinter = sPrinter
End Sub



ThomasAJ wrote:
You cannot do this. If each document "remembered" a specific
printer, it would cause problems when the document went to another
person.


Rubbish! If 'remembered' printer is not present then Word would use
the default printer. It might be called a 'Preferred Printer' and
reside in OPTIONS. A 5 minute programming exercise is all it would
have taken.

OK so make that 10 minutes of coding.

Very disappointing ommision by MS.

I've been coding since about '75 so I know what I am talking about.

In article ,
says...
We have many printers. How do I make a document remember which
printer it should use when the print icon is clicked on.

Sure I can use the printer drop-down box but I want certain
documents to remember their own 'default printer'.


You cannot do this. If each document "remembered" a specific
printer, it would cause problems when the document went to another
person.

--
Peter Aitken
Author, MS Word for Medical and Technical Writers
www.tech-word.com



  #8   Report Post  
Posted to microsoft.public.word.docmanagement
ThomasAJ ThomasAJ is offline
external usenet poster
 
Posts: 21
Default How to make a document 'remember' which printer.

Thanks for the code Graham.

Also please resist the urge to jump to conclusions regarding the
'experienced coder' aspect. I am very experienced but... not in Word VB.

--
Regards
Tom


"Graham Mayor" wrote:

I would have thought that such an experienced coder would have been able to
arrange something suitable and saved me the bother, but the following macro
in the document template (or at a pinch in the document itself - though that
raises the spectre of macro security) will do the job. The macro intercepts
the print button and looks for the string "COLOR" in the available printers
(converting to printer names to upper case) . You can change that string to
match the printer you require for the document.

Sub FilePrintDefault()
Dim StrPrinters As Variant, i As Long
Dim sPrinter As String
Dim sNone As String
StrPrinters = ListPrinters
sPrinter = ActivePrinter
If IsBounded(StrPrinters) Then
For i = LBound(StrPrinters) To UBound(StrPrinters)
If InStr(UCase(StrPrinters(i)), "COLOR") Then
ActivePrinter = StrPrinters(i)
GoTo PrintDoc
End If
Next i
sNone = MsgBox("Required printer not available" & vbCr & vbCr & _
"Print to default Word printer?", vbYesNo, "Printer
Error")
If sNone vbYes Then
MsgBox "Print cancelled"
ActivePrinter = sPrinter
Exit Sub
Else
GoTo PrintDoc
End If
Else
MsgBox "No printers found"
End If
Exit Sub
PrintDoc:
MsgBox "Printing to " & ActivePrinter
ActiveDocument.PrintOut
ActivePrinter = sPrinter
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



ThomasAJ wrote:
You cannot do this. If each document "remembered" a specific
printer, it would cause problems when the document went to another
person.


Rubbish! If 'remembered' printer is not present then Word would use
the default printer. It might be called a 'Preferred Printer' and
reside in OPTIONS. A 5 minute programming exercise is all it would
have taken.

OK so make that 10 minutes of coding.

Very disappointing ommision by MS.

I've been coding since about '75 so I know what I am talking about.

In article ,
says...
We have many printers. How do I make a document remember which
printer it should use when the print icon is clicked on.

Sure I can use the printer drop-down box but I want certain
documents to remember their own 'default printer'.


You cannot do this. If each document "remembered" a specific
printer, it would cause problems when the document went to another
person.

--
Peter Aitken
Author, MS Word for Medical and Technical Writers
www.tech-word.com




  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to make a document 'remember' which printer.

I have just added a page to my site with an add-in that will associate a
document with the required printer and print using that printer if it is
available. http://www.gmayor.com/Associate_Printer.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



ThomasAJ wrote:
Thanks for the code Graham.

Also please resist the urge to jump to conclusions regarding the
'experienced coder' aspect. I am very experienced but... not in Word
VB.


I would have thought that such an experienced coder would have been
able to arrange something suitable and saved me the bother, but the
following macro in the document template (or at a pinch in the
document itself - though that raises the spectre of macro security)
will do the job. The macro intercepts the print button and looks for
the string "COLOR" in the available printers (converting to printer
names to upper case) . You can change that string to match the
printer you require for the document.

Sub FilePrintDefault()
Dim StrPrinters As Variant, i As Long
Dim sPrinter As String
Dim sNone As String
StrPrinters = ListPrinters
sPrinter = ActivePrinter
If IsBounded(StrPrinters) Then
For i = LBound(StrPrinters) To UBound(StrPrinters)
If InStr(UCase(StrPrinters(i)), "COLOR") Then
ActivePrinter = StrPrinters(i)
GoTo PrintDoc
End If
Next i
sNone = MsgBox("Required printer not available" & vbCr & vbCr & _
"Print to default Word printer?", vbYesNo,
"Printer Error")
If sNone vbYes Then
MsgBox "Print cancelled"
ActivePrinter = sPrinter
Exit Sub
Else
GoTo PrintDoc
End If
Else
MsgBox "No printers found"
End If
Exit Sub
PrintDoc:
MsgBox "Printing to " & ActivePrinter
ActiveDocument.PrintOut
ActivePrinter = sPrinter
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



ThomasAJ wrote:
You cannot do this. If each document "remembered" a specific
printer, it would cause problems when the document went to another
person.


Rubbish! If 'remembered' printer is not present then Word would use
the default printer. It might be called a 'Preferred Printer' and
reside in OPTIONS. A 5 minute programming exercise is all it would
have taken.

OK so make that 10 minutes of coding.

Very disappointing ommision by MS.

I've been coding since about '75 so I know what I am talking about.

In article ,
says...
We have many printers. How do I make a document remember which
printer it should use when the print icon is clicked on.

Sure I can use the printer drop-down box but I want certain
documents to remember their own 'default printer'.


You cannot do this. If each document "remembered" a specific
printer, it would cause problems when the document went to another
person.

--
Peter Aitken
Author, MS Word for Medical and Technical Writers
www.tech-word.com



  #10   Report Post  
Posted to microsoft.public.word.docmanagement
Bob Buckland ?:-\) Bob   Buckland ?:-\) is offline
external usenet poster
 
Posts: 2,073
Default How to make a document 'remember' which printer.

Hi Graham,

Very nice When I suggested something on this line on the 18th, it seemed that I was forgetting something and of course now I do
recall it (sorry )

What we ended up having to do was to store the variable as hidden within the document (may have been a bookmark) rather than as a
document property to keep the 'remove hidden data' routine (now in Word 2007's
Office Button=Prepare=Inspect document)
from taking out the saved name again.

The document inspector can be customized but I'd suspect that it may be something some companies have setup to run the default
inspection somewhat automatically.

===============
"Graham Mayor" wrote in message ...
I have just added a page to my site with an add-in that will associate a
document with the required printer and print using that printer if it is
available. http://www.gmayor.com/Associate_Printer.htm

--

Graham Mayor - Word MVP
--

Bob Buckland ?:-)
MS Office Products MVP

*Courtesy is not expensive and can pay big dividends*


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I make word remember extra line between paragraph numbers ScottS Microsoft Word Help 3 January 25th 08 09:20 AM
Can I get Word 2007 to remember the View for each document? LurfysMa New Users 1 December 5th 07 11:12 AM
How do I make a word document always print to the same printer Neale Gibson Microsoft Word Help 1 May 30th 06 07:41 PM
I can't remember the name of a saved document but I do remember s. Ronda M Microsoft Word Help 3 December 12th 05 07:05 PM
can i use my printer to make out a pesonal check? Paul Ballou New Users 1 February 3rd 05 06:33 PM


All times are GMT +1. The time now is 04:03 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"