You have a folder full of mails from your
friends. Now you want to reply to each of them sending some fixed
message. One person will get only one reply no matter how many
mails are there from that user. Here’s how you can do
this:
- First write an email in Text
Format. - Save the email. It will go
to “Drafts” folder. Now drag that email to the folder which
contains all the emails you want to reply to. - Now press ALT+F11 and paste
the macro at the end of the post. - Hit F5 and wait for a long
time. You will see, Outbox has all the reply
emails.
The macro runs through each and every email
and then checks if the sender is already replied to. If not replied
to, then it gets the body of the message and then makes a reply by
combining your message with the body of the message.
The benefit of this approach is you are
replying to mails sent from someone which has low probability of
getting filtered out by spam filters.
Sub ReplytoALLEmail()
Dim objFolder As Folder
Dim objTemplate As MailItem
Set objTemplate = Application.ActiveExplorer.Selection.Item(1)
Set objFolder = objTemplate.Parent
Dim objItem As MailItem
Dim objReply As MailItem
Dim dic As New Dictionary
Dim strEmail As String
Dim strEmails As String
Dim strBody As String
strBody = objTemplate.Body
For Each objItem In objFolder.Items
If Not (objTemplate = objItem) Then
strEmail = objItem.SenderEmailAddress
If Not dic.Exists(strEmail) Then
strEmails = strEmails + strEmail + ";"
dic.Add strEmail, ""
Set objReply = objItem.Reply()
objReply.Body = strBody + vbCrLf + vbCrLf + objItem.Body
On Local Error Resume Next
objReply.Send
End If
End If
Next
Debug.Print strEmails
End Sub
Cool!
Haha, nice work 😀
hi,
id like to ask if anybody know how to reply to all the emails in one folder? i have created a folder for each type of emails received in the office and i was just wondering if there is a way to reply to each folder in one message sending, like reply all? instead of replying one by one. 🙁
thanks.
Just wanted to say thanks for this been looking for a solution for ages.
Omen what elements do I need to define. I keep getting user not defined errors when trying to run this.
Thanks
Mark.
Please let me know if there is a way to send all mails from my Drafts folder in Outlook 2003.
While running (F5) it stops on the following lines
Dim dic As New Dictionary
Renaming the above as
Dim dic As DocumentItem
The following error appears
runtime error 91
Object variable or with block variable not set.
Help please
Note : I am not from the software )
Hi,
I’ve tried this with HTML and it worked,
I couldn’t use the Dictionary object so I’ve dropped it
I have used FOLDERS object instead of folder
Thank you for your code!
Hila.
While running (F5) it stops on the following lines
Dim dic As New Dictionary
Renaming the above as
Dim dic As DocumentItem
The following error appears
runtime error 91
Object variable or with block variable not set.
Help please
Note : I am not from the software )
i have the same problem as another of your quests had… please revert
After pressing Alt+F11, go to Tools -> Reference. Find the Microsoft Scripting Runtime. check mark it. Then run the macro.
I’ve tried this script – and it worked for Outlook 2010 but not in that intention I would like..
Is it possible to mark 2 or more email in inbox and only reply them?
O.K. did the alt f11 so where do I paste the script then?
Ah sorted, exported the folder to Excel, sorted to exclude duplicates in transfer, copy list of e-mail addresses to Bcc & send mail. phew!