Hi, Pam. To get the file path (and other file info), I use a File System
Object. To use it, you'll have to set a reference in the VB Editor (Tools >
References) to "Microsoft Scripting Runtime".
I use the file system object a lot when presenting users with a dialog box
for selecting files, and when I want to know what folder that file is in.
Here's a code sample; I use this code specifically to provide users with a
dialog box in Word that lets them open PowerPoint files.
Probably what you're looking for are one of these two lines, which are in
the code:
AbsolutePath = fso.GetAbsolutePathName(vrtItem)
PathNoFile = fso.GetParentFolderName(vrtItem)
Hope this points you in the right direction:
Dim fso As New FileSystemObject ' provides access to the computer's file
system
Dim fd As FileDialog
Dim vrtItem As Variant
With fd
.Title = "Select PowerPoint File"
.AllowMultiSelect = False
.Filters.Add "PowerPoint files", "*.ppt", 1
.FilterIndex = 1
.InitialFileName = sDocPath
.InitialView = msoFileDialogViewList
If .Show = -1 Then
For Each vrtItem In .SelectedItems
AbsolutePath = fso.GetAbsolutePathName(vrtItem)
PathNoFile = fso.GetParentFolderName(vrtItem)
Next vrtItem
Else
Exit Function
End If
End With