WD: Macro to Change Default FileSaveAs Directory |
Q110629
In Word for Windows, the Save As command on the File menu always uses
the current directory by default. Since the current directory can change,
(for example when you insert a picture from a ClipArt directory), the
default directory may not be consistent.
To configure Word to default to a specific directory when saving files,
modify the FileSaveAs macro.
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 modify the FileSaveAs macro to default to a specific directory when Word
performs a Save As:
Sub MAIN
Dim dlg As FileSaveAs
GetCurValues dlg
Dialog dlg
Super FileSaveAs dlg
End Sub
Sub MAIN
Dim dlg As FileSaveAs
GetCurValues dlg
ChDir "C:\WINWORD" ' this line is new
n = Dialog dlg ' this line is modified
If n = - 1 Then Super FileSaveAs dlg ' this line is modified
End Sub
Sub MAIN
Dim dlg As FileSaveAs
GetCurValues dlg
ChDir "f:\winword" 'use any existing directory here
dlg.AddToMru = 1
If Dialog(dlg) Then FileSaveAs dlg
End Sub
NOTE: You can specify any valid path you want on the ChDir line.
default and change and working and directory and icon
Additional query words:
Keywords : kbmacro kbusage wordnt kbmacroexample winword word6 winword2 word7 word95
Issue type : kbhowto
Technology : kbWordSearch kbWord700Search kbZNotKeyword2 kbZNotKeyword3 kbWord600 kbWord600a kbWord600c kbWord200 kbWord200a kbWord200b kbWord200c kbWord700 kbWord600NT kbWord700a
|
Last Reviewed: November 5, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |