【发布时间】:2015-12-17 21:36:52
【问题描述】:
执行以下代码时,它会更改另存为对话框的目录并显示保存对话框,
With Dialogs(wdDialogFileSaveAs)
.Name = "c:\newfolder\"
.Show
End With
以下代码更改了打开对话框的默认目录并显示了打开对话框,
ChangeFileOpenDirectory "c:\newfolder\"
Options.DefaultFilePath(wdDocumentsPath) = CurDir
With Dialogs(wdDialogFileOpen)
.Show
End With
但是,我想要实现的是当用户单击 MS-Word 上的“保存”或“另存为”图标时,它总是需要显示特定目录(“c:\newfolder\”)。单击“保存”或“另存为”图标时,不会执行上述代码。我尝试将代码添加到DocumentBeforeSave event,但这会显示“另存为”对话框两次。
那么,当单击“保存”图标时,如何使 MS-Word 在“保存”对话框中始终如此特定的文件夹?
【问题讨论】:
标签: vba default ms-word savefiledialog