Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
Save Printer with document
Using Windows XP and Office 2007
We have a number of network printers. Is it possible to save the specific selected printer with a Word document so that when I open that document, it will already have the correct printer selected? |
#2
Posted to microsoft.public.word.newusers
|
|||
|
|||
Save Printer with document
Unfortunately, no, it is not possible to save printer selection with a
document. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "BK" wrote in message ... Using Windows XP and Office 2007 We have a number of network printers. Is it possible to save the specific selected printer with a Word document so that when I open that document, it will already have the correct printer selected? |
#3
Posted to microsoft.public.word.newusers
|
|||
|
|||
Save Printer with document
While strictly that is accurate, it can be worked around by saving the
printer information in a document variable or custom property and interrogating the document variables/properties at print time to see if a printer has been recorded and selecting that printer for the job. Actually I thought I had included the macros to provide this function on my http://www.gmayor.com/fax_from_word.htm page, but apparently I haven't. Seems like a task for the weekend -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Suzanne S. Barnhill wrote: Unfortunately, no, it is not possible to save printer selection with a document. "BK" wrote in message ... Using Windows XP and Office 2007 We have a number of network printers. Is it possible to save the specific selected printer with a Word document so that when I open that document, it will already have the correct printer selected? |
#4
Posted to microsoft.public.word.newusers
|
|||
|
|||
Save Printer with document
Just in case I don't get around to my web page, the code required (store in
the normal template or the relevant document template) would be as follows. The first macro will record the named printer in the current document. Run the macro and save the document. The other two macros intercept the fileprint and fileprintdefault commands that print the document to establish whether the variable is present in the current document and if it is print to that document. It makes no allowance for a named printer not being available, though extra error trapping could be included. Sub SetHPAsDocumentPrinter() Dim oVars As Variables Set oVars = ActiveDocument.Variables oVars("varPrinter").Value = "HP LaserJet 4050 Series PCL" End Sub Sub FilePrintDefault() Dim oVars As Variables Dim vVar As Variant Dim bExists As Boolean Dim sPrinter As String sPrinter = ActivePrinter Set oVars = ActiveDocument.Variables bExists = False For Each vVar In oVars If vVar.name = "varPrinter" Then bExists = True With Dialogs(wdDialogFilePrintSetup) sPrinter = .Printer .Printer = oVars("VarPrinter").Value .DoNotSetAsSysDefault = True .Execute 'MsgBox "Printing to " & ActivePrinter ActiveDocument.PrintOut .Printer = sPrinter .DoNotSetAsSysDefault = True .Execute End With Exit For End If Next vVar If bExists = False Then 'MsgBox "Printing to " & ActivePrinter ActiveDocument.PrintOut End If End Sub Sub FilePrint() Dim oVars As Variables Dim vVar As Variant Dim bExists As Boolean Dim sPrinter As String sPrinter = ActivePrinter Set oVars = ActiveDocument.Variables bExists = False For Each vVar In oVars If vVar.name = "varPrinter" Then bExists = True With Dialogs(wdDialogFilePrintSetup) sPrinter = .Printer .Printer = oVars("VarPrinter").Value .DoNotSetAsSysDefault = True .Execute Dialogs(wdDialogFilePrint).Show .Printer = sPrinter .DoNotSetAsSysDefault = True .Execute End With Exit For End If Next vVar If bExists = False Then Dialogs(wdDialogFilePrint).Show End Sub http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: While strictly that is accurate, it can be worked around by saving the printer information in a document variable or custom property and interrogating the document variables/properties at print time to see if a printer has been recorded and selecting that printer for the job. Actually I thought I had included the macros to provide this function on my http://www.gmayor.com/fax_from_word.htm page, but apparently I haven't. Seems like a task for the weekend Suzanne S. Barnhill wrote: Unfortunately, no, it is not possible to save printer selection with a document. "BK" wrote in message ... Using Windows XP and Office 2007 We have a number of network printers. Is it possible to save the specific selected printer with a Word document so that when I open that document, it will already have the correct printer selected? |
#5
Posted to microsoft.public.word.newusers
|
|||
|
|||
Save Printer with document
I thought when I posted earlier that I had included this on my web site. I
looked for it on the wrong page ( The correct link would be 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 Graham Mayor wrote: Just in case I don't get around to my web page, the code required (store in the normal template or the relevant document template) would be as follows. The first macro will record the named printer in the current document. Run the macro and save the document. The other two macros intercept the fileprint and fileprintdefault commands that print the document to establish whether the variable is present in the current document and if it is print to that document. It makes no allowance for a named printer not being available, though extra error trapping could be included. Sub SetHPAsDocumentPrinter() Dim oVars As Variables Set oVars = ActiveDocument.Variables oVars("varPrinter").Value = "HP LaserJet 4050 Series PCL" End Sub Sub FilePrintDefault() Dim oVars As Variables Dim vVar As Variant Dim bExists As Boolean Dim sPrinter As String sPrinter = ActivePrinter Set oVars = ActiveDocument.Variables bExists = False For Each vVar In oVars If vVar.name = "varPrinter" Then bExists = True With Dialogs(wdDialogFilePrintSetup) sPrinter = .Printer .Printer = oVars("VarPrinter").Value .DoNotSetAsSysDefault = True .Execute 'MsgBox "Printing to " & ActivePrinter ActiveDocument.PrintOut .Printer = sPrinter .DoNotSetAsSysDefault = True .Execute End With Exit For End If Next vVar If bExists = False Then 'MsgBox "Printing to " & ActivePrinter ActiveDocument.PrintOut End If End Sub Sub FilePrint() Dim oVars As Variables Dim vVar As Variant Dim bExists As Boolean Dim sPrinter As String sPrinter = ActivePrinter Set oVars = ActiveDocument.Variables bExists = False For Each vVar In oVars If vVar.name = "varPrinter" Then bExists = True With Dialogs(wdDialogFilePrintSetup) sPrinter = .Printer .Printer = oVars("VarPrinter").Value .DoNotSetAsSysDefault = True .Execute Dialogs(wdDialogFilePrint).Show .Printer = sPrinter .DoNotSetAsSysDefault = True .Execute End With Exit For End If Next vVar If bExists = False Then Dialogs(wdDialogFilePrint).Show End Sub http://www.gmayor.com/installing_macro.htm Graham Mayor wrote: While strictly that is accurate, it can be worked around by saving the printer information in a document variable or custom property and interrogating the document variables/properties at print time to see if a printer has been recorded and selecting that printer for the job. Actually I thought I had included the macros to provide this function on my http://www.gmayor.com/fax_from_word.htm page, but apparently I haven't. Seems like a task for the weekend Suzanne S. Barnhill wrote: Unfortunately, no, it is not possible to save printer selection with a document. "BK" wrote in message ... Using Windows XP and Office 2007 We have a number of network printers. Is it possible to save the specific selected printer with a Word document so that when I open that document, it will already have the correct printer selected? |
#6
Posted to microsoft.public.word.newusers
|
|||
|
|||
Save Printer with document
Thanks for all this information. Seems like it would be a lot easier to
just change the printer preference when I open the document! grin "Graham Mayor" wrote in message ... I thought when I posted earlier that I had included this on my web site. I looked for it on the wrong page ( The correct link would be 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 Graham Mayor wrote: Just in case I don't get around to my web page, the code required (store in the normal template or the relevant document template) would be as follows. The first macro will record the named printer in the current document. Run the macro and save the document. The other two macros intercept the fileprint and fileprintdefault commands that print the document to establish whether the variable is present in the current document and if it is print to that document. It makes no allowance for a named printer not being available, though extra error trapping could be included. Sub SetHPAsDocumentPrinter() Dim oVars As Variables Set oVars = ActiveDocument.Variables oVars("varPrinter").Value = "HP LaserJet 4050 Series PCL" End Sub Sub FilePrintDefault() Dim oVars As Variables Dim vVar As Variant Dim bExists As Boolean Dim sPrinter As String sPrinter = ActivePrinter Set oVars = ActiveDocument.Variables bExists = False For Each vVar In oVars If vVar.name = "varPrinter" Then bExists = True With Dialogs(wdDialogFilePrintSetup) sPrinter = .Printer .Printer = oVars("VarPrinter").Value .DoNotSetAsSysDefault = True .Execute 'MsgBox "Printing to " & ActivePrinter ActiveDocument.PrintOut .Printer = sPrinter .DoNotSetAsSysDefault = True .Execute End With Exit For End If Next vVar If bExists = False Then 'MsgBox "Printing to " & ActivePrinter ActiveDocument.PrintOut End If End Sub Sub FilePrint() Dim oVars As Variables Dim vVar As Variant Dim bExists As Boolean Dim sPrinter As String sPrinter = ActivePrinter Set oVars = ActiveDocument.Variables bExists = False For Each vVar In oVars If vVar.name = "varPrinter" Then bExists = True With Dialogs(wdDialogFilePrintSetup) sPrinter = .Printer .Printer = oVars("VarPrinter").Value .DoNotSetAsSysDefault = True .Execute Dialogs(wdDialogFilePrint).Show .Printer = sPrinter .DoNotSetAsSysDefault = True .Execute End With Exit For End If Next vVar If bExists = False Then Dialogs(wdDialogFilePrint).Show End Sub http://www.gmayor.com/installing_macro.htm Graham Mayor wrote: While strictly that is accurate, it can be worked around by saving the printer information in a document variable or custom property and interrogating the document variables/properties at print time to see if a printer has been recorded and selecting that printer for the job. Actually I thought I had included the macros to provide this function on my http://www.gmayor.com/fax_from_word.htm page, but apparently I haven't. Seems like a task for the weekend Suzanne S. Barnhill wrote: Unfortunately, no, it is not possible to save printer selection with a document. "BK" wrote in message ... Using Windows XP and Office 2007 We have a number of network printers. Is it possible to save the specific selected printer with a Word document so that when I open that document, it will already have the correct printer selected? |
#7
Posted to microsoft.public.word.newusers
|
|||
|
|||
Save Printer with document
Not when all the work has been done for you, but that is indeed a
possibility - if you can remember to do so and you can remember which printer it was configured for eg see also printing to a suitable available printer e.g a colour printer at http://www.gmayor.com/fax_from_word.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org BK wrote: Thanks for all this information. Seems like it would be a lot easier to just change the printer preference when I open the document! grin "Graham Mayor" wrote in message ... I thought when I posted earlier that I had included this on my web site. I looked for it on the wrong page ( The correct link would be 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 Graham Mayor wrote: Just in case I don't get around to my web page, the code required (store in the normal template or the relevant document template) would be as follows. The first macro will record the named printer in the current document. Run the macro and save the document. The other two macros intercept the fileprint and fileprintdefault commands that print the document to establish whether the variable is present in the current document and if it is print to that document. It makes no allowance for a named printer not being available, though extra error trapping could be included. Sub SetHPAsDocumentPrinter() Dim oVars As Variables Set oVars = ActiveDocument.Variables oVars("varPrinter").Value = "HP LaserJet 4050 Series PCL" End Sub Sub FilePrintDefault() Dim oVars As Variables Dim vVar As Variant Dim bExists As Boolean Dim sPrinter As String sPrinter = ActivePrinter Set oVars = ActiveDocument.Variables bExists = False For Each vVar In oVars If vVar.name = "varPrinter" Then bExists = True With Dialogs(wdDialogFilePrintSetup) sPrinter = .Printer .Printer = oVars("VarPrinter").Value .DoNotSetAsSysDefault = True .Execute 'MsgBox "Printing to " & ActivePrinter ActiveDocument.PrintOut .Printer = sPrinter .DoNotSetAsSysDefault = True .Execute End With Exit For End If Next vVar If bExists = False Then 'MsgBox "Printing to " & ActivePrinter ActiveDocument.PrintOut End If End Sub Sub FilePrint() Dim oVars As Variables Dim vVar As Variant Dim bExists As Boolean Dim sPrinter As String sPrinter = ActivePrinter Set oVars = ActiveDocument.Variables bExists = False For Each vVar In oVars If vVar.name = "varPrinter" Then bExists = True With Dialogs(wdDialogFilePrintSetup) sPrinter = .Printer .Printer = oVars("VarPrinter").Value .DoNotSetAsSysDefault = True .Execute Dialogs(wdDialogFilePrint).Show .Printer = sPrinter .DoNotSetAsSysDefault = True .Execute End With Exit For End If Next vVar If bExists = False Then Dialogs(wdDialogFilePrint).Show End Sub http://www.gmayor.com/installing_macro.htm Graham Mayor wrote: While strictly that is accurate, it can be worked around by saving the printer information in a document variable or custom property and interrogating the document variables/properties at print time to see if a printer has been recorded and selecting that printer for the job. Actually I thought I had included the macros to provide this function on my http://www.gmayor.com/fax_from_word.htm page, but apparently I haven't. Seems like a task for the weekend Suzanne S. Barnhill wrote: Unfortunately, no, it is not possible to save printer selection with a document. "BK" wrote in message ... Using Windows XP and Office 2007 We have a number of network printers. Is it possible to save the specific selected printer with a Word document so that when I open that document, it will already have the correct printer selected? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I save my choice of printer as part of a document? | Microsoft Word Help | |||
How do I save printer settings to a certain document? | Microsoft Word Help | |||
Save/Save As Menu Options Don't Save Document | Microsoft Word Help | |||
Clicking on the Printer icon, up pops a "Save As" Screen. | New Users | |||
How do I save printer settings per document? | Microsoft Word Help |