Folder name known, how to determine Folder Path? (1 Viewer)

elliotgr

Registered User.
Local time
Today, 18:11
Joined
Dec 30, 2010
Messages
67
In Win 7 a portion of the folder name is known (xxxx\yyyy), the whole drive must be searched to return the folder path. The drive name may be different on diffent machines. Is there any code to search from the bottom up, compatible with Win 7.
As a last resort, a file name is known to reside in the folder, code that returns the file path/s would also be suitable.
Thanks
 

krowe

Registered User.
Local time
Today, 08:11
Joined
Mar 29, 2011
Messages
159
Is the folder in the same location relative to you db on each machine?

I use this following code to retireve the folder of the DB then i can navigate to an associated folder from there:

Code:
Dim mypath As String
Dim mypath3 As String
 
mypath = Left$(CurrentDb.Name, Len(CurrentDb.Name) - Len(Dir$(CurrentDb.Name)))
    mypath3 = mypath & "LetterTemplates\ClientLetter.docx"

this code will go to a file called ClientLetter.docx that sits in a Folder called LetterTemplates in the same directory as the DB frontend. It doesnt matter what drive the database is located in, so long as the folder is in the same relative location.

not sure if this helps at all...
 

elliotgr

Registered User.
Local time
Today, 18:11
Joined
Dec 30, 2010
Messages
67
Thank, but the folder can be anywhere on the hard drive, so the entire hard drive would have to be searched from the root
 

Users who are viewing this thread

Top Bottom