Set default directory using wdDialogCopyFile

J

John

Using the method outlined on the mvp site to allow a user to browse and select a folder

With Dialogs(wdDialogCopyFile
If .Display <> 0 The
MsgBox "You chose " & .Director
Els
MsgBox "Dialog cancelled
End I
End Wit

Is there a way to specify a default folder the dialog opens to rather than having it open to whatever folder was selected last? I'd like to have the window always start at c:\ if possible

Any help would be greatly appreciated. Thanks
John
 
M

Martin Seelhofer

Hi John

You can use the method ChangeFileOpenDirectory of the application.object:
Application.ChangeFileOpenDirectory "C:\"
or simply:
ChangeFileOpenDirectory "C:\"


Cheers,

Martin


John said:
Using the method outlined on the mvp site to allow a user to browse and select a folder:

With Dialogs(wdDialogCopyFile)
If .Display <> 0 Then
MsgBox "You chose " & .Directory
Else
MsgBox "Dialog cancelled"
End If
End With

Is there a way to specify a default folder the dialog opens to rather than
having it open to whatever folder was selected last? I'd like to have the
window always start at c:\ if possible.
 
J

Jonathan West

Hi John

You can set the .Directory property to the folder you want, before you call
the .Display method.

--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup

John said:
Using the method outlined on the mvp site to allow a user to browse and select a folder:

With Dialogs(wdDialogCopyFile)
If .Display <> 0 Then
MsgBox "You chose " & .Directory
Else
MsgBox "Dialog cancelled"
End If
End With

Is there a way to specify a default folder the dialog opens to rather than
having it open to whatever folder was selected last? I'd like to have the
window always start at c:\ if possible.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top