Reply to all with attachments in Outlook 2003

Posted on 2008-11-20
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
    LVL 76

    Accepted Solution

    Hi, bbrq750.

    Change line 46 to
        Set myReplyItem = myItem.ReplyAll

    Author Closing Comment

    Thanks.  Easy when you know how.
    LVL 76

    Expert Comment

    by:David Lee
    You're welcome, Mick.

    "Easy when you know how."
    Very true.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Title # Comments Views Activity
    Microsoft Dynamics Roles question 4 25
    Long-term car rental costs (2 months) 7 43
    Inequality 4 47
    Compound interest rate 3 42
    Phishing is at the top of most security top 10 efforts you should be pursuing in 2016 and beyond. If you don't have phishing incorporated into your Security Awareness Program yet, now is the time. Phishers, and the scams they use, are only going to …
    Digital marketing agencies have encountered both the opportunities and difficulties that emerge from working with a wide-ranging organizations.
    After watching the Introduction to GIMP this tutorial will show you additional tools to use in GIMP.
    Introduction to GIMP:  GNU Image Manipulation Program. It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now