
Getting open file name w/o opening file
Hi Dermot
To choose a filename without opening a file, try this
With Dialogs(wdDialogFileOpen)
If .Display Then
MsgBox .Name
Else
MsgBox "No file selected"
End If
End With
If you want the full pathname, do it this way
With Dialogs(wdDialogFileOpen)
If .Display Then
MsgBox WordBasic.FilenameInfo$(.Name, 1)
Else
MsgBox "No file selected"
End If
End With
If you want to pick a folder without the opportunity to pick a file, then
take a look at this article
How to allow the user to browse to and select a folder
http://www.mvps.org/word/FAQs/MacrosVBA/BrowsDialog.htm
--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email
I'd like to be able to ask the user to pick a folder name (if necessary, a
file
in that folder) so I can add the folder to a favourites list. But I don't
want to
actually open the file.
Excel has a dialog box to get a filename from the user without opening the
file.
I can't find this in Word.
Can anyone help me?
TIA
dermot balson