Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2006

Tip: Looking for answers? Try searching our database.

Show a list of files in a specified directory with an command button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wilfried - 23 Sep 2006 16:12 GMT
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
Doug Robbins - Word MVP - 23 Sep 2006 17:49 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.