Sending Multiple Emails to Same user With Different Attachments through Outlook

I send about thirty emails which has distinct attachments to the same emails. I am right clicking each file and using "Send To". I need to type the email dresses each time. Is there a queuing function in MS Outlook? Or, is there a VBA code I can use to achieve the same thing.
Summary
1. 30 Distinct Files
2. Will be sent to the same emails.
3. There needs to be 30 separate emails.
awesomejohn19Asked:
Who is Participating?
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Try if this sub works for you. You can apply it to an opened or selected mail (works both). But be aware the original mail gets deleted.
Sub SendAllAttachments()
Dim srcItm As Object, att As Attachment
  If TypeName(Outlook.ActiveWindow) = "Explorer" Then
    Set srcItm = Outlook.ActiveExplorer.Selection.Item(1)
  Else
    Set srcItm = Outlook.ActiveInspector.CurrentItem
  End If
  If srcItm.Class = olMail Then
    For Each att In srcItm.Attachments
      With Application.CreateItem(olMailItem)
        .To = srcItm.To
        .CC = srcItm.CC
        .Subject = att.FileName
        .Attachments.Add att
        .Send
      End With
    Next
    srcItm.Delete
  End If
End Sub

Open in new window


Triggering this code can be done in many ways. As-is, you should add a button in your quick access bar either of Outlook or the Edit Mail form (use the small down error in that bar to edit). You should see the sub in "Macros" if you do. Add it by moving it to the right, and choose an icon if you like.
After having added the button, all you have to do is select the mail or open/create it, then press that particular button.

Another approach for triggering the code is by using a rule "on send", but that requires to change the sub slightly.
0
 
Dan CraciunIT ConsultantCommented:
There will be someone soon here with a VBA solution.

If you want something a bit different, try AutoIT. It's designed to solve exactly the type of repetitive tasks that you posted.

Note: you'll need a basic understanding of programming constructs to be able to code in AutoIT. Or you could use AU3 Recorder :)

HTH,
Dan
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Are you doing that same action regularly?
  Are the email addresses the same?
  Are that 30 file names the same each time?
Can't you use a group for the addresses?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
awesomejohn19Author Commented:
1. Yes, I do this daily.
2 & 4 Email addresses are the same and I am using groups.
3. File names are different and they should be the subject of every email.

The trouble I am having is

I Need to right click --> Send to ---> put the email address group name --> Remove Emailing: from the subject line --> Click send.

I am wondering if there is a way to automate this easily so I wont have to go  and do this 30 times a day. It just takes couple minutes but it'll be much easier if everything  is done automatically.
0
 
awesomejohn19Author Commented:
Thanks Dan,

I know how to program on VBA. Last time I did it for Outlook was years ago and there were lots of security features which basically made it difficult to write code MS Outlook to send emails.

:) I know Autoit as well and I was hoping I could avoid it. It has been years since I last used it but I'll check it again. Thanks,
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Before I start assembling something in VBA, how about you creating a single mail with all attachments, and then run VBA code on that to get your mails as requested? VBA could be triggered with a button in the Quick Access bar of the email form window.
0
 
awesomejohn19Author Commented:
Qlemo, I apologize if I misunderstood you. Here is the code that is seen when I open the VBA editor. I dont belive this is the one you are looking for.

"Private Sub Application_Reminder(ByVal Item As Object)
  Dim objMsg As MailItem
  Set objMsg = Application.CreateItem(olMailItem)
 
 
If Item.MessageClass <> "IPM.Appointment" Then
  Exit Sub
End If
 
If Item.Categories <> "Send Message" Then
  Exit Sub
End If
 
 
  objMsg.To = Item.Location
  objMsg.Subject = Item.Subject
  objMsg.Body = Item.Body
  objMsg.Send
 
 
  Set objMsg = Nothing
End Sub
"
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
I was talking about the way how to start the real stuff code. Manually create a new mail. Drag all files on the it. Press a button starting the code we have to write up.
0
 
awesomejohn19Author Commented:
Ok, I did open a new mail ----> Drag the files ----> I opened the VBA editor.

Sorry if I am still not following you.
0
 
awesomejohn19Author Commented:
Thanks, I think this is exactly what I am looking for but it doesnt work for some reason. I open a mail window with the attachments and hit the macro button and nothing happens. What might be the reason?
0
 
awesomejohn19Author Commented:
Ok sorry, Macros were disabled. It gives a runtime error 438 - object doesn't support this property or method. It highlights attachments.add att  line
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Oops, forgot about this question - sorry.
Replace olMailItem by olMail in line 10.
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.

All Courses

From novice to tech pro — start learning today.