troubleshooting Question

How do a remove a space and comma from the outlook sendername?

Avatar of Michael Spellman
Michael SpellmanFlag for United States of America asked on
OutlookScripting Languages
1 Comment1 Solution235 ViewsLast Modified:
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
                    Else
                        Exit Do
                    End If
                Loop
                olkAttachment.SaveAsFile strRootFolderPath & Item.SenderName & ".xls"
                               
            End If
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros