Return file name from FileOpen.Display?

E

Ed

I'm trying to get the document name from the FileOpen dialog box using
..Display. I'm also trying to set it so the box will open showing All Files,
rather than defaulting to Word docs only. But I can't seem to find the
parameter that returns the file name. Can someone fill in the ???? for me,
please?

Ed

Set dlgFName = Dialogs(wdDialogFileOpen)
With dlgFName
.Name = "*.*"
.Display
strFName = ????
End With
 
E

Ed

Ed said:
I'm trying to get the document name from the FileOpen dialog box using
.Display. I'm also trying to set it so the box will open showing All Files,
rather than defaulting to Word docs only. But I can't seem to find the
parameter that returns the file name. Can someone fill in the ???? for me,
please?
To clarify further: I'm looking for the FullName. Is this possible?
Ed

Set dlgFName = Dialogs(wdDialogFileOpen)
With dlgFName
.Name = "*.*"
.Display
strFName = ????
End With
 
E

Ed

Thanks for responding, Jezebel. As I played with it while waiting, I typed
..Name, but the AutoComplete didn't come up, so I didn't think it was valid.
I typed it in anyway, and got the file name, but not the FullName, including
path. I also realized I probably couldn't do ".Name = "*.*" to show All
Files when the dialog box comes up. I can do without that, if I can just
get the full name including path.

Ed
 
J

Jonathan West

Ed said:
Thanks for responding, Jezebel. As I played with it while waiting, I typed
.Name, but the AutoComplete didn't come up, so I didn't think it was valid.
I typed it in anyway, and got the file name, but not the FullName, including
path. I also realized I probably couldn't do ".Name = "*.*" to show All
Files when the dialog box comes up. I can do without that, if I can just
get the full name including path.

Try this

strFName = WordBasic.FileNameInfo$(.Name, 1)
 
Top