I have a rule that runs a script that renames the excel attachment as the outlook sendername. The sendername becomes: LastName, FirstName , so my filename includes the space and the comma. I would like to remove the space & comma and name the file the LastName_FirstName.xls
How do I accomplish that?
Thanks - here is an extract of the rename script:
For Each olkAttachment In Item.Attachments
If objFSO.GetExtensionName(LCase(olkAttachment.FileName)) = "xls" Then
strFilename = olkAttachment.FileName
intCount = 0
Do While True
If objFSO.FileExists(strRootFolderPath & strFilename) Then
intCount = intCount + 1
strFilename = "Copy (" & intCount & ") of " & olkAttachment.FileName
olkAttachment.SaveAsFile strRootFolderPath & Item.SenderName & ".xls"