如何在Outlook中不带附件进行存档?
如何在Outlook中不带附件进行存档?
通常,Outlook的存档功能将保存所有电子邮件元素,包括电子邮件内容,电子邮件标头,电子邮件附件等。但是,附件可能会使存档的PST文件变大。 在这里,我将介绍两种在Outlook中不带附件的存档解决方案。
由VBA存档,无附件
不带附件的Microsoft Outlook存档
由VBA存档,无附件
此方法将引入VBA,从要存档的指定文件夹中删除所有附件,然后可以不包含附件进行存档。 请执行以下操作:
1。 在 邮件 视图,选择要存档的文件夹,然后按 其他 + F11 键以打开“ Microsoft Visual Basic应用程序”窗口。
2。 点击 插页 > 模块,然后在VBA下面粘贴到新的模块窗口中。
VBA:从Outlook中的选定邮件文件夹中删除所有附件
Public Sub SaveDeleteAttachments()Dim xMailItem As Outlook.MailItem 'ObjectDim xAttachments As Outlook.AttachmentsDim i As LongDim xFolder As FolderDim xFilePath As StringDim xFldPath As StringDim xDeletedFilePath As StringOn Error Resume NextxFldPath = CreateObject("WScript.Shell").SpecialFolders(16)xFldPath = xFldPath & "MyAttachments"If Dir(xFldPath, vbDirectory) = "" ThenMkDir xFldPathEnd IfSet xFolder = Outlook.Application.ActiveExplorer.CurrentFolderFor Each xMailItem In xFolder.ItemsIf xMailItem.Class = olMail ThenSet xAttachments = xMailItem.AttachmentsWhile xAttachments.Count > 0xFilePath = xAttachments.Item(1).FileNamexFilePath = xFldPath & "" & xFilePathxAttachments.Item(1).SaveAsFile xFilePathxAttachments.Item(1).DeleteIf xMailItem.BodyFormat <> olFormatHTML ThenxDeletedFilePath = xDeletedFilePath & vbCrLf & "<file://" & xFilePath & ">"ElsexDeletedFilePath = xDeletedFilePath & "
" & "" & xFilePath & ""End IfWendIf xDeletedFilePath <> "" ThenIf xMailItem.BodyFormat <> olFormatHTML ThenxMailItem.Body = "The file(s) were saved to: " & xDeletedFilePath & vbCrLf & xMailItem.BodyElsexMailItem.HTMLBody = "
” & _”The file(s) were saved to: ” & xDeletedFilePath & “
" & xMailItem.HTMLBodyEnd IfxMailItem.SavexDeletedFilePath = ""End IfEnd IfNextExit Sub:Set xAttachments = NothingSet xMailItem = NothingEnd Sub
3. Press the F5 key or click the Run button to run the code. Then all attachments are removed from the selected mail folder immediately.
4. Click File > Info > Tools > Clean Up Old Items (or File > Info > Cleanup Tools > Archive).
5. In the Archive dialog box, please click to highlight the copied folder, type TODAY in the Archive items older than box, and then click the Browse button. See screenshot:
6. In the Open Outlook Data Files dialog box, please open the folder you will save the archived PST file in, name the PST file in the File name box, and then click the OK button. See screenshot:
7. Now you return to the Archive dialog box, please click the OK button to finish the archiving.
So far, you have archived the mail folder without any attachments.
Archive without attachments by Microsoft Outlook
If you have Microsoft Outlook installed, you can apply its Detach All feature to quickly delete all attachments from the specified folder you will archive, and then archive without attachments easily.
Microsoft Outlook: Add more than 100 handy tools for Outlook, free to try with no limitation in 60 days. Read More Free Trial Now
1. In the Mail view, open the specified mail folder you will archive, select all emails with pressing Ctrl + A keys, and then click Kutools > Detach All. See screenshot:
2. In the Please select a folder dialog box, click the Browse button to specify the folder you will save the attachment in, specify a subfolder style from the create subfolders in the following style drop down list, and click the Ok button. See screenshot:
3. Please click Yes button and OK button successively in the popping out dialog boxes.
4. Go on to click File > Info > Tools > Clean Up Old Items (or File > Info > Cleanup Tools > Archive).
5. In the Archive dialog box, please click to highlight the specified folder you will archive without attachments, type TODAY in the Archive items older than box, and then click the Browse button. See screenshot:
6. In the Open Outlook Data Files dialog box, please open the folder you will save the archived PST file in, name the PST file in the File name box, and then click the OK button. See screenshot:
7. Now you return to the Archive dialog box, please click the OK button to finish the archiving.
So far, you have archived the specified mail folder without attachments already.
Microsoft Outlook: Add more than 100 handy tools for Outlook, free to try with no limitation in 60 days. Read More Free Trial Now
Related Articles
How to automatically archive attachments only in Outlook?
How to archive emails by year/month/date in Outlook?
免责声明:
1、本站所有资源文章出自互联网收集整理,本站不参与制作,如果侵犯了您的合法权益,请联系本站我们会及时删除。
2、本站发布资源来源于互联网,可能存在水印或者引流等信息,请用户擦亮眼睛自行鉴别,做一个有主见和判断力的用户。
3、本站资源仅供研究、学习交流之用,若使用商业用途,请购买正版授权,否则产生的一切后果将由下载用户自行承担。
4、侵权违法和不良信息举报 举报邮箱:cnddit@qq.com
还没有评论,来说两句吧...