I am going to use the code to reply all with attachments in search results from All Mailboxes but it shows me an error and does not work.
please let me know how to change the code to be usable for All Mailboxes.
Best regards
Shahrooz
When we forward an email message in Microsoft Outlook, original attachments in this email message are remained in the forwarded message. However, when we reply an email message, the original attachments will not be attached in the new reply message. Here we are going to introduce a couple of tricks about keeping original attachments when replying in Microsoft Outlook.
Reply with attachments by manually copying and pasting
Reply with attachments automatically by VBA
One click to reply with attachments with Kutools for Outlook
We can manually copy original attachments in an email messages, and paste them in the Reply Message window when we reply the email message later.
Step 1: Click the email message to preview it in the Reading Pane.
Step 2: Right click one attachment in the previewing email message, and select the Select All from the right-clicking menu.
Step 3: Right click the selected attachments, and select the Copy from the right-clicking menu.
Step 4: Reply the email message with clicking the Reply button on the Home tab (or on the Toolbar in Outlook 2007).
Step 5: In the Replying message window, click the Paste button on the Message tab to paste these attachments.
If you are using Outlook 2013 or the later version, click the Pop Out at the upper-left corner of Reading Pane to release the Replying message window. Click to know more…
Step 6: Compose the replying message, and Click the Send button.
Easily reply email with original attachments in Outlook:
Kutools for Outlook's Reply with Attachment utility can help you easily reply a received email with it's original attachments in Outlook. See the below demo:
Download and try it now! (
60-day free trail)
There is a VBA macro that can help you reply with original attachments automatically.
Note: Before you run any VBA macros, you need to enable macros in Microsoft Outlook.
Step 1: Select the email message that you will reply with its attachments.
Step 2: Press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window.
Step 3: Expand the Project1 and Microsoft Outlook Objects in the left bar, and double-click the ThisOutlookSession to open it.
Step 4: Paste the following code into the ThisOutlookSession window.
Sub RunReplyWithAttachments() 'Update by Extendoffice 20180830 Dim xReplyItem As Outlook.MailItem Dim xItem As Object On Error Resume Next Set xItem = GetCurrentItem() If xItem Is Nothing Then Exit Sub Set xReplyItem = xItem.Reply CopyAttachments xItem, xReplyItem xReplyItem.Display Set xReplyItem = Nothing Set xItem = Nothing End Sub Sub RunReplyAllWithAttachments() Dim xReplyAllItem As Outlook.MailItem Dim xItem As Object Set xItem = GetCurrentItem() If xItem Is Nothing Then Exit Sub Set xReplyAllItem = xItem.ReplyAll CopyAttachments xItem, xReplyAllItem xReplyAllItem.Display Set xReplyAllItem = Nothing Set xItem = Nothing End Sub Function GetCurrentItem() As Object On Error Resume Next Select Case TypeName(Application.ActiveWindow) Case "Explorer" Set GetCurrentItem = Application.ActiveExplorer.Selection.Item(1) Case "Inspector" Set GetCurrentItem = Application.ActiveInspector.currentItem End Select End Function Sub CopyAttachments(SourceItem As MailItem, TargetItem As MailItem) Dim xFilePath As String Dim xAttachment As Attachment Dim xFSO As Scripting.FileSystemObject Dim xTmpFolder As Scripting.Folder Dim xFldPath As String Set xFSO = New Scripting.FileSystemObject Set xTmpFolder = xFSO.GetSpecialFolder(2) xFldPath = xTmpFolder.Path & "\" For Each xAttachment In SourceItem.Attachments If IsEmbeddedAttachment(xAttachment) = False Then xFilePath = xFldPath & xAttachment.Filename xAttachment.SaveAsFile xFilePath TargetItem.Attachments.Add xFilePath, , , xAttachment.DisplayName xFSO.DeleteFile xFilePath End If Next Set xFSO = Nothing Set xTmpFolder = Nothing End Sub Function IsEmbeddedAttachment(Attach As Attachment) Dim xAttParent As Object Dim xCID As String, xID As String Dim xHTML As String On Error Resume Next Set xAttParent = Attach.Parent xCID = "" xCID = Attach.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3712001F") If xCID <> "" Then xHTML = xAttParent.HTMLBody xID = "cid:" & xCID If InStr(xHTML, xID) > 0 Then IsEmbeddedAttachment = True Else IsEmbeddedAttachment = False End If End If End Function
Step 5: Press the F5 key to run this macro. In the opening Macros dialog box, click RunReplyAllWithAttachments if you want to reply to all with attachments. Otherwise, select RunReplyWithAttachments, then click the Run button.
Then it opens the Replying message window with attaching all of original attachments.
Step 6: Compose the replying message, and click Send button.
The Reply with Attach utility of Kutools for Outlook can help you to reply emails with original attachments with just one click.
Kutools for Outlook : with more than 100+ handy Outlook add-ins, free to try with no limitation in 60 days.
1. Select the email contains the attachments you need to reply with.
2. Then click Kutools > Reply with Attachment > Reply with Attachment. See screenshot:
Then all attachments of selected email are listed in the Attached field of the reply message. Compose your email and send it.
If you want to have a free trial of this utility, please go to free download the software first, and then go to apply the operation according above steps.
If you want to have a free trial ( 60-day) of this utility, please click to download it, and then go to apply the operation according above steps.