![]() |
|
||||||||
| Site Links |
| Consulting |
| Knowledge Base |
| Training |
| Forum |
| Articles |
| Resources |
| Products |
| Cool Tools |
| Contact |
| About Us |
| Go to Page... |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
|
Hello,
Using VBA in Outlook, I am trying to save attachments from a handful of daily emails and rename the files using the SAME name each day, essentially replacing the set of files each day. I have the code to save the attachments, but I'm stumped when it comes to renaming the files. The email subject lines and the files have the date in them, and I would like to save the files without the date (Example, if the email subject line reads "Weekly Dashboard 3/25/12 - 3/31/12", the file is "Weekly Dashboard 3/25/12 - 3/31/12.xlsx". I need the file to be renamed "Weekly Dashboard.xlsx". Here is the code I have so far (I also attached it for easier viewing). Can someone help me out? VBA:
VBA tags courtesy of www.thecodenet.com
|
|
Local Time: 04:17 AM
Local Date: 05-21-2013 Location:
|
|
|
|
#2 |
|
|
Replace:
VBA:
VBA tags courtesy of www.thecodenet.com
VBA:
VBA tags courtesy of www.thecodenet.com
|
|
Local Time: 12:17 PM
Local Date: 05-21-2013 |
|
|
|
#3 |
|
|
I replaced the code and got this error message:
"An unexpected error has occurred. Please note and report the following information. Macro Name: GetAttachments Error Number: 5 Error Description: Invalid procedure call or argument" Is this because some of the files have a date and some do not? |
|
Local Time: 04:17 AM
Local Date: 05-21-2013 Location:
|
|
|
|
#4 | |||||||||||||||||||||||
|
|
Yes, probably, though it's difficult to know for certain without seeing the actual file name with which it fails. Try this instead (entirely replaces my previous code): VBA:
VBA tags courtesy of www.thecodenet.com
If it still doesn't work, set a breakpoint on a suitable line and debug it in the VB editor. |
|||||||||||||||||||||||
|
Local Time: 12:17 PM
Local Date: 05-21-2013 |
|
|
|
#5 |
|
|
Thanks for the help! It didn't quite work, so I'll try to debug it.
|
|
Local Time: 04:17 AM
Local Date: 05-21-2013 Location:
|
|
![]() |
| Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|


