Reply to all with attachments in Outlook 2003

Posted on 2008-11-20
Medium Priority
Last Modified: 2012-05-05
I have found a solution from jeepstyx22 for how to Reply with attachments - by creating a macro and assigning it to a toolbar button as below.  That works fine, but does someone know how to edit the code to create a macro for Reply to All with attachments?
Follow the steps below and you can create a new button on your message toolbar which will create a reply and attach any current file attachments.
In outlook main windows go to Tools->Macro->Visual Basic Editor.
In the visual Basic Editor goto Insert->Module.
Paste the code at the end of this message.
Open a new message.
Goto View->Toolbars->Customize.
Select the Commands Tab.
Click the command Rearrange Commands
Select the Toolbar Radio Button.
Verify that the drop down box next to the button says Standard.
Click the Add button.
Select Macros from the left list. and in the right list Project1.ReplyWithAttach should be highlighted.
Click OK
Move the command up or down to position it where you like. Then click close.  You should now see a button that says Project1.ReplyWithAttach
Public Sub ReplyWithAttach()
    'Make declarations
    Dim myOlApp As Outlook.Application
    Dim myInspector As Outlook.Inspector
    Dim myItem As Outlook.MailItem
    Dim myReplyItem As Outlook.MailItem
    Dim myAttachments As Outlook.Attachments
    Dim myReplyAttachments As Outlook.Attachments
    Dim fso
    Dim TempFolder As String
    Set fso = CreateObject("Scripting.FileSystemObject")
    TempFolder = fso.GetSpecialFolder(2)
    Set myOlApp = CreateObject("Outlook.Application")
    Set myInspector = myOlApp.ActiveInspector
    'Create variable to store files names 10 max if you need more then 10, change the value below
    Dim filenames(10) As String
    If Not TypeName(myInspector) = "Nothing" Then
        If TypeName(myInspector.CurrentItem) = "MailItem" Then
            Set myItem = myInspector.CurrentItem
            Set myAttachments = myItem.Attachments
            If myAttachments.Count > 0 Then
                For Count = 1 To myAttachments.Count
                    myAttachments.Item(Count).SaveAsFile "c:\" & myAttachments.Item(Count).DisplayName
                    filenames(Count) = myAttachments.Item(Count).DisplayName
                Set myItem = myInspector.CurrentItem
                Set myReplyItem = myItem.Reply
                Set myReplyAttachments = myReplyItem.Attachments
                For Count = 1 To myAttachments.Count
                    myReplyAttachments.Add "c:\" & filenames(Count), olByValue, 1, "4th Quarter 1996 Results Chart"
                    fso.DeleteFile "c:\" & filenames(Count)
            End If
            MsgBox "The item is of the wrong type."
        End If
    End If
End Sub

Open in new window

Question by:bbrq750
  • 2
LVL 76

Accepted Solution

David Lee earned 500 total points
ID: 23022452
Hi, bbrq750.

Change line 46 to
    Set myReplyItem = myItem.ReplyAll

Author Closing Comment

ID: 31518629
Thanks.  Easy when you know how.
LVL 76

Expert Comment

by:David Lee
ID: 23024757
You're welcome, Mick.

"Easy when you know how."
Very true.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Stuck in voice control mode on your Amazon Firestick?  Here is how to turn it off!!!
This article is written by John Gates, CISSP. Gates, the SNUG President-Elect, currently holds the position of Manager of Information Systems at Lake Park High School in Roselle, Illinois.
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
Where to go on the main page to find the job listings. How to apply to a job that you are interested in from the list that is featured on our Careers page.

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question