How to Change Default Settings in the File Print Dialog Box |
Q117621
6.00 6.00a 6.00c 7.00 WINDOWS kbusage kbmacro kbhowtoBy 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.
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:
Sub MAIN
Dim dlg As FilePrint
GetCurValues dlg
Dialog dlg
FilePrint dlg
End Sub
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.
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 "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 :
Issue type :
Technology :
|
Last Reviewed: November 4, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |