• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3644
  • Last Modified:

Reply to all with attachments in Outlook 2003

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
                Next
                
                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"
                    myReplyItem.Display
                    fso.DeleteFile "c:\" & filenames(Count)
                Next
                
            End If
        Else
            MsgBox "The item is of the wrong type."
        End If
    End If
End Sub

Open in new window

0
bbrq750
Asked:
bbrq750
  • 2
1 Solution
 
David LeeCommented:
Hi, bbrq750.

Change line 46 to
 
    Set myReplyItem = myItem.ReplyAll
0
 
bbrq750Author Commented:
Thanks.  Easy when you know how.
Mick
0
 
David LeeCommented:
"Thanks."
You're welcome, Mick.

"Easy when you know how."
Very true.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now