如何快速添加和轉發多封電子郵件 Zip Outlook 中的附件

立即分享:

當您需要將大量電子郵件轉發給某人時,您可能會想要將它們全部合併成一個壓縮檔案。因此,本文將教您如何快速地將多封電子郵件轉發為單一壓縮檔案。 zip 附件。

Outlook 允許用戶將多封電子郵件作為附件轉發。 說實話,很方便。 但是,如果要轉發的電子郵件數量相當大,您肯定希望將它們壓縮到一個文件中,例如 zip 文件。 除了將它們保存到本地驅動器並壓縮它們之外,這裡我們將介紹另一種方法,它可以讓您將多封電子郵件作為單個郵件轉發 zip 一鍵添加附件。

快速添加和轉發多封電子郵件 Zip Outlook 中的附件

添加並轉發多封電子郵件作為 Zip 附件

  1. 首先,像往常一樣啟動 Outlook。
  2. 然後,在 Outlook 窗口中按“Alt + F11”鍵按鈕。
  3. 隨後,您將成功訪問 Outlook VBA 編輯器窗口。
  4. 此時,您可以打開一個未使用的模塊或簡單地插入一個新模塊。
  5. 接下來,您需要將以下 VBA 代碼複製到該模塊中。
Sub ForwardMultipleEmailsAsZipAttachment()
    Dim objSelection As Outlook.Selection
    Dim objMail As Outlook.MailItem
    Dim strSubject As String
    Dim strTempFolder As String
    Dim varTempFolder As Variant
    Dim objShell As Object
    Dim varZipFile As Variant
    Dim objForward As Outlook.MailItem
 
    Set objSelection = Application.ActiveExplorer.Selection
 
    If Not (objSelection Is Nothing) Then
 
       'Save selected emails to Temporary folder
       strTempFolder = CStr(Environ("USERPROFILE")) & "\AppData\Local\Temp"
       varTempFolder = strTempFolder & "\Temp " & Format(Now, "dd-mm-yyyy- hh-mm-ss-")
       MkDir (varTempFolder)
       varTempFolder = varTempFolder & "\"

       For Each objMail In objSelection
 
           strSubject = objMail.Subject
 
           'Remove unsupported characters in the subject
           strSubject = Replace(strSubject, "/", " ")
           strSubject = Replace(strSubject, "\", " ")
           strSubject = Replace(strSubject, ":", "")
           strSubject = Replace(strSubject, "?", " ")
           strSubject = Replace(strSubject, Chr(34), " ")
 
           objMail.SaveAs varTempFolder & strSubject & ".msg", olMsg
       Next
    
       'Create a new zip file
       varZipFile = InputBox("Specify a name for the new zip file", "Name Zip File")
       varZipFile = strTempFolder & "\" & varZipFile & ".zip"
       Open varZipFile For Output As #1
       Print #1, Chr$(80) & Chr$(75) & Chr$(5) & Chr$(6) & String(18, 0)
       Close #1
 
       'Copy all the saved emails to the new zip file
       Set objShell = CreateObject("Shell.Application")
       objShell.NameSpace(varZipFile).CopyHere objShell.NameSpace(varTempFolder).Items

       'Keep macro running until compressing is done
       On Error Resume Next
       Do Until objShell.NameSpace(varZipFile).Items.Count = objShell.NameSpace(varTempFolder).Items.Count
          Application.Wait (Now + TimeValue("0:00:01"))
       Loop
       On Error GoTo 0
 
       Set objMail = Application.CreateItem(olMailItem)
 
       'Add the zip attachment to a new email
       With objMail
            .Attachments.Add varZipFile
            .Display
       End With
    End If
End Sub

VBA 代碼 - 將多封電子郵件作為一個轉發 Zip 附件

  1. 之後,您可以退出當前宏。
  2. 為了以後方便訪問,您最好將此宏添加到快速訪問工具欄。
  3. 最後,您可以嘗試一下。
  • 首先,選擇您要轉發給其他人的電子郵件。
  • 接下來,單擊快速訪問工具欄中的宏按鈕。
  • 然後,您將需要輸入壓縮文件的名稱。
  • 輸入名稱並點擊“確定”後,將顯示一封新電子郵件,其中您將看到 zip 附上文件,如下面的截圖:在新郵件中新增 Zip 附件

在附近準備一個優質的維修工具

隨著 Outlook 中存儲的電子郵件越來越多,PST 文件將越來越大。 在這種情況下,Outlook 會出現各種錯誤,甚至崩潰。 因此,你最好保持強健的心態 PST維修 附近的工具,例如 DataNumen Outlook Repair。 由於其高恢復率,它是一個強烈推薦的工具。

作者簡介:

Shirley Zhang是的數據恢復專家 DataNumen,Inc.是數據恢復技術的全球領導者,包括 損壞的SQL 和Outlook修復軟件產品。 欲了解更多信息,請訪問 萬維網。datanumen.COM

立即分享:

評論被關閉。