我希望 Outlook 自动将每封发送的电子邮件保存为指定目录中的文本文件。
答案1
你好,Wayne Walton,
方法 1:使用 Outlook 规则和 VBA 脚本
Enable Developer Tab:
In Outlook, go to File > Options.
Click on Customize Ribbon.
Check the box for Developer in the right column.
Click OK.
Open Visual Basic for Applications (VBA):
Click on the Developer tab.
Click Visual Basic.
Create a New Module:
Right-click on any item in the project explorer on the left.
Choose Insert > Module.
Paste the VBA Script:
Copy and paste the following VBA script into the module:
虚拟专用网络
Sub SaveSentEmail(Item 作为 Outlook.MailItem) Dim objFileSystem 作为对象 Dim objTextFile 作为对象 Dim strFileName 作为字符串 Dim strFolderPath 作为字符串
' Set the folder path where you want to save the text files
strFolderPath = "C:\Path\To\Your\Folder\"
' Create the file name using the email subject
strFileName = strFolderPath & Item.Subject & ".txt"
' Create a FileSystemObject
Set objFileSystem = CreateObject("Scripting.FileSystemObject")
' Create or open the text file
Set objTextFile = objFileSystem.CreateTextFile(strFileName, True)
' Write the email body to the text file
objTextFile.Write Item.Body
' Close the text file
objTextFile.Close
子目录结束
Create a Rule to Run the Script:
Go back to Outlook.
Go to File > Manage Rules & Alerts.
Click New Rule.
Select Apply rule on messages I send.
Click Next until you reach the Finish Rule Setup window.
Check Run a script and click on a script in the bottom box.
Select the SaveSentEmail script and click Add, then OK.
Complete the rule setup and click Finish.
方法2:使用第三方工具
还有一些第三方工具可以自动将已发送的电子邮件保存到指定文件夹或以各种格式保存。一些流行的工具包括:
CodeTwo Outlook Export: A paid tool that allows you to save Outlook emails to different formats automatically.
MessageExport by Encryptomatic: Another paid tool that provides advanced options for saving Outlook emails.