How to allow the user to browse to and select a folder
Article contributed by Jonathan West / updated by Lene Fredborg
There are two options available.
1. |
Use the Copy File dialog: With
Dialogs(wdDialogCopyFile) The advantage is that it is quick & simple, but the disadvantage is that you can't change the caption of the dialog, which says “Copy”. |
2. |
If you are using Word 2002 (Office XP) or later, you can use the built-in FileDialog object. With
Application.FileDialog(msoFileDialogFolderPicker) The above is a simple code sample, you can do more in terms of setting the dialog caption and the starting folder. Look up the details in the VBA Help. |