I'm working with Outlook and used a combination of a Rule and VBA to automatically save files of a specific name to a folder. When I try to enter my own file name, it corrupts the file. It won't let me edit the name. I'm using this:
This adds the date before the current file name and saves it to a specified location. I'm looking to edit my code to save files, keep the extension (to avoid corrupting the file), and change the name of the file. What should I use to call the current extension of the file?For Each objAtt In itm.Attachments If InStr(objAtt.DisplayName, ".xlsx") Then objAtt.SaveAsFile saveFolder & "\" & dateFormat & " - " & objAtt.DisplayName End If Set objAtt = Nothing Next
One other issue: I currently have it set to only save .xlsx files because the signature contains a picture that automatically saves. Is there a way to not download the .jpg or .png file, rather than only download the .xlsx?