by tprothma » Mon May 17, 2004 12:08 pm
I've searched all of the forum topics, even downloaded the scripting help file, but can't figure out the syntax to output the filename (would actually prefer it without the extension)
For instance, I want to script to give me an column for the file named "c:\My Documents\Tweetie.mp3". itm.Path gives the full path and filename + extension. I want only the filename "Tweetie" and would prefer a separate one for file extension "mp3".
I have tried this for Excel:
WS.Cells(i+2,8).Value = itm.Path
WS.Cells(i+2,9).Value = itm.FileName
But it doesn't work.
Is there an itm.somthing that would work.
Alternatively might be able to parse itm.path backwards util I reach a \ in the string, but I'm not good at scripting.
Any help would be appreciated.
Thanks,
Tim
I've searched all of the forum topics, even downloaded the scripting help file, but can't figure out the syntax to output the filename (would actually prefer it without the extension)
For instance, I want to script to give me an column for the file named "c:\My Documents\Tweetie.mp3". itm.Path gives the full path and filename + extension. I want only the filename "Tweetie" and would prefer a separate one for file extension "mp3".
I have tried this for Excel:
WS.Cells(i+2,8).Value = itm.Path
WS.Cells(i+2,9).Value = itm.FileName
But it doesn't work.
Is there an itm.somthing that would work.
Alternatively might be able to parse itm.path backwards util I reach a \ in the string, but I'm not good at scripting.
Any help would be appreciated.
Thanks,
Tim