How to Change Default Settings in the File Print Dialog Box

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 and then choose the Create button. Word opens a macro editing window with the following macro text:


  4. 
       Sub MAIN
       Dim dlg As FilePrint
       GetCurValues dlg
       Dialog dlg
       FilePrint dlg
       End Sub 
  5. 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.


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


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

Additional query words: 6.00a sticky persistent persists word7 word6 6.00c word95 winword persist stick sticks

Keywords :
Version : WINDOWS:6.0,6.0a,6.0c,7.0
Platform : WINDOWS
Issue type :


Last Reviewed: October 1, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.