Skip to main content

How to rename attachments in Outlook window without saving to disc?

For attachments of received email message, you may want to rename these attachments for easily recognizing in future work. Actually, there has no Outlook build-in function for you to directly rename attachments in Outlook window without saving them to disc. In this article, we will show you methods of renaming attachments in Outlook.

Automatically save and rename attachments with VBA code in Outlook
Easily rename attachments in email without saving to disc with Kutools for Outlook


Save and rename attachments with VBA code in Outlook

In this section, we will provide a VBA code to automatically save the attachments of selected email. After saving, you can see the last modified date of the attachments was added as a prefix to the original attachment names. Please do as follows.

1. In the Documents folder, create a new folder named Attachments to save and rename the attachments of a selected email.

2. Select the email with attachments you want to save and rename with modified dates.

3. Press Alt + F11 keys simultaniously to open the Microsoft Visual Basic for Application window. In the Microsoft Visual Basic for Application window, click Insert > Module, and then paste below VBA code into the Module window.

VBA code: Save attachments and add modified date before file name

Public Sub saveattachmentsadddate()
	Dim itm As Outlook.MailItem
	Dim currentExplorer As Explorer
	Dim Selection As Selection
	Dim objAtt As Outlook.Attachment
	Dim saveFolder As String
	Dim fso As Object
	Dim oldName
	Dim file As String
	Dim DateFormat As String
	Dim newName As String
	Dim enviro As String
	enviro              = CStr(Environ("USERPROFILE"))
	saveFolder          = enviro & "\Documents\Attachments\"
	Set currentExplorer = Application.ActiveExplorer
	Set Selection       = currentExplorer.Selection
	Set fso             = CreateObject("Scripting.FileSystemObject")
	On Error Resume Next
	For Each itm In Selection
		For Each objAtt In itm.Attachments
			file = saveFolder & objAtt.DisplayName
			objAtt.SaveAsFile file
			'Get the file name
			Set oldName  = fso.GetFile(file)
			DateFormat   = Format(oldName.DateLastModified, "yyyy-mm-dd ")
			newName      = DateFormat & objAtt.DisplayName
			oldName.Name = newName
			Set objAtt   = Nothing
		Next
	Next
	Set fso = Nothing
End Sub

4. Press the F5 key to run the code, and the attachments in selected email are saved to the folder "\Documents\Attachments\" and the last modified date of the attachments was added as a prefix to the original attachment names automatically.

Notes:

1. If you want to rename any one of the attachments in selected email instead of all in bulk, this method can't work.
2. This code will also save and rename other objects such as images, charts, shapes and so on in the email body.

Easily rename attachments in email without saving to disc with Kutools for Outlook

Here highly recommended the Rename Attachments feature of Kutools for Outlook. With this feature, you can directly rename attachments in Outlook window without saving to disc.

Kutools for Outlook : with more than 100 handy Outlook add-ins, free to try with no limitation in 60 days.

1. After installing Kutools for Outlook, please select an email which the attachments you will rename, and then click Kutools > Attachment Tools > Rename All.

2. In the Attachments Rename dialog box, you can see all attachments' name of selected email are listed in the Name column. Please double click an attachment name to edit, and then click the OK button to save the changes.
Tips: You can modify all attachment names or just modify any one of the attachment names as you need in the dialog box.

Then attachments are renamed in the selected email window. 

Note: You can rename a certain attachment by selecting it in the Reading Pane, clicking Kutools > Rename, in the rename dialog box, typing a new name in the Name box and then clicking the OK button to save it. See screenshot:

If you want to have a free trial of this utility, please go to free download the software first, and then go to apply the operation according above steps.


Related articles:


Best Office Productivity Tools

Kutools for Outlook - Over 100 Powerful Features to Supercharge Your Outlook

🤖 AI Mail Assistant: Instant pro emails with AI magic--one-click to genius replies, perfect tone, multilingual mastery. Transform emailing effortlessly! ...

📧 Email Automation: Out of Office (Available for POP and IMAP)  /  Schedule Send Emails  /  Auto CC/BCC by Rules When Sending Email  /  Auto Forward (Advanced Rules)   /  Auto Add Greeting   /  Automatically Split Multi-Recipient Emails into Individual Messages ...

📨 Email Management: Easily Recall Emails  /  Block Scam Emails by Subjects and Others  /  Delete Duplicate Emails  /  Advanced Search  /  Consolidate Folders ...

📁 Attachments ProBatch Save  /  Batch Detach  /  Batch Compress  /  Auto Save   /  Auto Detach  /  Auto Compress ...

🌟 Interface Magic: 😊More Pretty and Cool Emojis   /  Boost Your Outlook Productivity with Tabbed Views  /  Minimize Outlook Instead of Closing ...

👍 One-click Wonders: Reply All with Incoming Attachments  /   Anti-Phishing Emails  /  🕘Show Sender's Time Zone ...

👩🏼‍🤝‍👩🏻 Contacts & Calendar: Batch Add Contacts From Selected Emails  /  Split a Contact Group to Individual Groups  /  Remove Birthday Reminders ...

Over 100 Features Await Your Exploration! Click Here to Discover More.

Read More       Free Download      Purchase
 

 

Comments (9)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Well, that didn't work. Thanks for nothing.
This comment was minimized by the moderator on the site
Dear Mike,
Any problem with the method, please don't hesitate to let me know. Thank you for your comment.
This comment was minimized by the moderator on the site
I can only echo previous comments: I would like to be able to re-name the file when I forward it. I wouldn't want to re-name the original that I received from a client. I need to be able to re-name when I'm passing on files internally and they need to comply with internal naming conventions. It's a shame that this is not available.
This comment was minimized by the moderator on the site
Dear SG,
The suggestion was adopted. We are trying to enhance the function to be more useful. We really appreciate your advice.
This comment was minimized by the moderator on the site
I think it is essential that you can re-name files in message that you want to forward. I need to keep the original name of a file in the original e-mail, but re-name to comply with internal naming conventions before I pass it on internally. So, I need to be able to see both entries.
This comment was minimized by the moderator on the site
Nice tool with the Kutools add on. There is a condition I think is confusing people. You can't rename it in the message if you pop the message out of the main Outlook Window. You have to be in the main Outlook interface, highlight the attachment, then the ATTACHMENT TOOLS tab turns on. There, appears a second KUTOOLS tab with the rename option in the original email.
This comment was minimized by the moderator on the site
Nice tool with Kutools! I find that the rename option is available on the original email only if you haven't popped the email out of the Outlook Interface. The Attachment Tools tab is highlighted and you have to switch to the Kutools tab under the Attachment Tools tab. I think that is where people are getting confused.
This comment was minimized by the moderator on the site
Nice software, but it sucks that you can only change the name of the file AFTER an email has been sent. That defeats the purpose. Want to change the name when creating a new email just after having attached the file BEFORE sending out.
This comment was minimized by the moderator on the site
yes, want to change name before send out, the feature is very important to us.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations