跳到主要內容

如何在Outlook窗口中重命名附件而不保存到光盤?

對於收到的電子郵件的附件,您可能需要重命名這些附件,以便在以後的工作中輕鬆識別。 實際上,沒有Outlook內置功能可讓您直接在Outlook窗口中重命名附件而不將其保存到光盤中。 在本文中,我們將向您展示在Outlook中重命名附件的方法。

在Outlook中使用VBA代碼自動保存和重命名附件
使用Kutools for Outlook輕鬆重命名電子郵件中的附件而無需保存到光盤


在Outlook中使用VBA代碼保存和重命名附件

在本部分中,我們將提供VBA代碼以自動保存所選電子郵件的附件。 保存後,您可以看到附件的最後修改日期已添加為原始附件名稱的前綴。 請執行以下操作。

1。 在裡面 文件 文件夾,創建一個名為 附件 保存並重命名所選電子郵件的附件。

2.選擇帶有您要保存的附件的電子郵件,然後使用修改後的日期重命名。

3。 按 其他 + F11 同時打開鑰匙 Microsoft Visual Basic應用程序 窗口。 在裡面 Microsoft Visual Basic應用程序 窗口中,單擊 插入 > 模塊,然後將以下VBA代碼粘貼到“模塊”窗口中。

VBA代碼:保存附件並在文件名之前添加修改的日期

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。 按 F5 鍵運行代碼,並將所選電子郵件中的附件保存到該文件夾 “ \ Documents \ Attachments \” 附件的最後修改日期會自動添加為原始附件名稱的前綴。

筆記:

1.如果要重命名所選電子郵件中的任何一個附件而不是全部重命名,則此方法無效。
2.此代碼還將在電子郵件正文中保存並重命名其他對象,例如圖像,圖表,形狀等。

使用Kutools for Outlook輕鬆重命名電子郵件中的附件而無需保存到光盤

這裡強烈推薦 重命名附件 的特點 Kutools for Outlook。 使用此功能,您可以直接在Outlook窗口中重命名附件,而無需保存到光盤。

Kutools for Outlook :擁有100多個方便的Outlook加載項, 60天免費試用.

1.安裝後 Kutools for Outlook,請選擇要重命名附件的電子郵件,然後單擊 庫工具 > 附件工具 > 重命名全部.

2。 在裡面 附件重命名 對話框中,您可以看到所選電子郵件的所有附件名稱都列在 姓名 柱。 請雙擊附件名稱進行編輯,然後單擊 OK 按鈕保存更改。
保養竅門:您可以修改所有附件名稱,也可以只在對話框中根據需要修改任何附件名稱。

然後,附件將在選定的電子郵件窗口中重命名。 

備註:您可以通過在閱讀窗格中選擇某個附件,然後單擊它來重命名該附件 庫工具 > 重命名,在重命名對話框中,在 姓名 框,然後單擊 OK 按鈕進行保存。 看截圖:

如果您想免費試用該實用程序,請轉到 免費下載軟件 首先,然後按照上述步驟進行操作。


相關文章:


最佳辦公生產力工具

Kutools for Outlook - 超過 100 種強大的功能可增強您的 Outlook

🤖 人工智慧郵件助手: 具備人工智慧魔力的即時專業電子郵件——一鍵天才回覆、完美語調、多語言掌握。輕鬆改變電子郵件! ……

📧 電子郵件自動化: 外出(適用於 POP 和 IMAP)  /  安排發送電子郵件  /  發送電子郵件時按規則自動抄送/密件副本  /  自動轉送(進階規則)   /  自動添加問候語   /  自動將多收件者電子郵件拆分為單獨的訊息 ...

📨 電子郵件管理: 輕鬆回憶電子郵件  /  按主題和其他人阻止詐騙電子郵件  /  刪除重複的電子郵件  /  進階搜索  /  合併資料夾 ...

📁 附件專業版批量保存  /  批量分離  /  批量壓縮  /  自動保存   /  自動分離  /  自動壓縮 ...

🌟 介面魔法: 😊更多又漂亮又酷的表情符號   /  使用選項卡式視圖提高 Outlook 工作效率  /  最小化 Outlook 而不是關閉 ...

👍 一鍵奇蹟: 使用傳入附件回覆全部  /   反網路釣魚電子郵件  /  🕘顯示寄件者的時區 ...

👩🏼‍🤝‍👩🏻 通訊錄和行事曆: 從選定的電子郵件中大量新增聯絡人  /  將聯絡人群組拆分為各組  /  刪除生日提醒 ...

超過 100特點 等待您的探索! 按此處了解更多。

閱讀更多       免費下載      購買
 

 

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