ShortName
You could put this in your standard module.
Sub ShowShortName(filespec)
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(filespec)
s = "The short name for " & "" & UCase(f.Name)
s = s & "" & vbCrLf
s = s & "is: " & "" & f.ShortName & ""
MsgBox s, 0, "Short Name Info"
End Sub
Then use it like a Function to display a pop up message:
Sub shw()
ShowShortName(MyText)
End Sub
"Robin Clay" wrote:
Greetings ! and a Happy New Year !
This works OK:-
For J = 1 To .FoundFiles.Count Step 1
myText = .FoundFiles(J)
...
returning the long file name of each file in turn
But how can I get the SHORT filename of each in turn ?
myText = .FoundFiles(J).ShortName
doesn't work.
Regards
Robin
|