How to Change Default Settings in the File Print Dialog Box

Last reviewed: August 4, 1997
Article ID: 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 95, 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:

  1. From the Tools menu, choose Macro.

  2. From the Macros Available In list, select All Active Templates or Normal.dot (Global Template).

  3. In the Macro Name box, type "FilePrint" (without the quotation marks) and then choose the Create button. Word opens a macro editing window with the following macro text:

       Sub MAIN
       Dim dlg As FilePrint
       GetCurValues dlg
       Dialog dlg
       FilePrint dlg
       End Sub
    
    

  4. 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.
    
    

  5. 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:
    
       Sub MAIN
       Dim dlg As FilePrint
       GetCurValues dlg
       dlg.Collate = 0
       n = Dialog dlg
       If n = - 1 Then FilePrint dlg
       End Sub
    
    

  6. 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.

REFERENCES

"Microsoft Word Developer's Kit," version 6.0, Microsoft Press, 1994, pages 436-437

Kbcategory: kbusage kbmacro kbhowto KBSubcategory:


Additional reference words: 6.00 6.00a sticky persistent persists
word7 word6 6.00c 7.00 word95 winword persist stick sticks
Version : 6.00 6.00a 6.00c 7.00
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 4, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.