Microsoft KB Archive/117621

{|
 * width="100%"|

How to Change Default Settings in the File Print Dialog Box

 * }

Q117621

6.00 6.00a 6.00c 7.00 WINDOWS kbusage kbmacro kbhowto

-

The information in this article applies to:


 * Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
 * Microsoft Word for Windows, version 7.0

-

SYMPTOMS
By design, Word for Windows does not retain most of the settings you select in the File Print dialog box. When you close the File Print dialog box, Word restores the program defaults for all settings except the Print To File option. This article describes how you can modify the FilePrint Word command to change the default settings in the File Print dialog box.

MORE INFORMATION
Only the Print To File option in the File Print dialog box retains the setting you selected last time you ran the command. You can use WordBasic commands to modify the FilePrint command to change the other settings.

Word is designed so that if you create a macro with the same name as a Word command, the macro runs instead of the Word command. For example, if you create a macro named FilePrint, it runs instead of the Word command of the same name. Use the following procedure to create a FilePrint macro that sets different printing defaults:

 From the Tools menu, choose Macro. From the Macros Available In list, select All Active Templates or Normal.dot (Global Template). In the Macro Name box, type FilePrint and then choose the Create button. Word opens a macro editing window with the following macro text:  Change the macro to the following:   Sub MAIN Dim dlg As FilePrint GetCurValues dlg 'Add commands for new default settings HERE n = Dialog dlg                            ' modified line If n = - 1 Then FilePrint dlg             ' modified line End Sub WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.   Use the table below to find the syntax for the File Print setting you want to change. Insert the command on a new line, after the "GetCurValues dlg" command in the above macro (in the above macro, replace the "Add commands for new default settings HERE" comment with the new commands). To change more than one setting, add lines to the macro at this location.   To change this setting        Add this line       Comments --       -

Copies                       dlg.NumCopies = n   Where n is a number

Print Range (choose one): Selection*                 dlg.Range = 1       *See comment below Current Page               dlg.Range = 2 Pages                      dlg.Range = 4

Print (choose one):                              Default is All Odd Pages                  dlg.Order = 1 Even Pages                 dlg.Order = 2

Collate Copies Off           dlg.Collate = 0     Default is On

* If nothing is selected in your document, the macro prints the current page. For example, to clear the Collate Copies option by default, change your FilePrint macro to the following:  Close the macro editing window and choose Yes when Word prompts you to save changes to the FilePrint macro. IMPORTANT: If, when you quit Word, it prompts you to save changes to NORMAL.DOT, be sure to choose Yes. Otherwise, Word will not save the FilePrint macro you modified.