如何“回复所有人”并在 Outlook 中保留原始附件?

Saa*_*aar 4 microsoft-outlook email

如何在 Outlook 中执行“回复所有人”,但将原始附件重新发送回所有人?

ale*_*ale 6

显然不是没有一些 VBA 代码。这是我发现的东西,旨在做到这一点。(来源

说明:此 Outlook VBA 示例创建并显示对当前打开或选定的邮件的回复,包括原始邮件中的附件。

Sub ReplyWithAttachments()
    Dim rpl As Outlook.MailItem
    Dim itm As Object

    Set itm = GetCurrentItem()
    If Not itm Is Nothing Then
        Set rpl = itm.Reply
        CopyAttachments itm, rpl
        rpl.Display
    End If

    Set rpl = Nothing
    Set itm = Nothing
End Sub

Function GetCurrentItem() As Object
    Dim objApp As Outlook.Application

    Set objApp = Application
    On Error Resume Next
    Select Case TypeName(objApp.ActiveWindow)
        Case "Explorer"
            Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
        Case "Inspector"
            Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
    End Select

    Set objApp = Nothing
End Function

Sub CopyAttachments(objSourceItem, objTargetItem)
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set fldTemp = fso.GetSpecialFolder(2) ' TemporaryFolder
   strPath = fldTemp.Path & "\"
   For Each objAtt In objSourceItem.Attachments
      strFile = strPath & objAtt.FileName
      objAtt.SaveAsFile strFile
      objTargetItem.Attachments.Add strFile, , , objAtt.DisplayName
      fso.DeleteFile strFile
   Next

   Set fldTemp = Nothing
   Set fso = Nothing
End Sub
Run Code Online (Sandbox Code Playgroud)

代码注意事项:

  1. 使用该GetCurrentItem()函数返回当前选择或显示的项目。

  2. 使用CopyAttachments()程序将附件复制到回复中。

  3. 更换itm.Replyitm.ReplyAll,如果你喜欢回复所有。

(哦,我在大约 30 秒内通过网络搜索“用 Outlook 中的附件回复所有人”发现了这一点)。