I try to see the list of the files in a specified directory. I try to
do it with a ncommand button in a access form. Give the list of all the
files (word-documents and e-mails) in for instance the directory c:\My
documents/ examples
This function, posted by fellow MVP Jonathon West, will work in all versions
of Word from 97
onwards
Public Function BrowseFile() As String
With Dialogs(wdDialogFileOpen)
If .Display <> -1 Then
BrowseFile = ""
Else
BrowseFile = WordBasic.FileNameInfo$(.Name, 1)
End If
End With
End Function
It returns the full pathname of the selected file, and a blank string if no
selection is made.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I try to see the list of the files in a specified directory. I try to
> do it with a ncommand button in a access form. Give the list of all the
> files (word-documents and e-mails) in for instance the directory c:\My
> documents/ examples
wilfried - 23 Sep 2006 22:38 GMT
I thank you already for your answer. My knowledge of access (and VBA)
is not so good. Can you please insert the path 'c:\My documents/
examples" into your answer so that I can use your answer in my access
form with a command button.
Doug Robbins - Word MVP schreef:
> This function, posted by fellow MVP Jonathon West, will work in all versions
> of Word from 97
[quoted text clipped - 25 lines]
> > files (word-documents and e-mails) in for instance the directory c:\My
> > documents/ examples