Hey Guys, I have some code below which was sending an email containing an attachment to a whole bunch of recipients that were listed in excel. I now need to change that code so that the email just contains the attached file and lets the user send to who ever they want to manually imput in outlook.
Can anyone assist me with the code that opens the outlook email with the attachment and allows the user to type in the email addresses they wish to send it to?
Cheers!
Can anyone assist me with the code that opens the outlook email with the attachment and allows the user to type in the email addresses they wish to send it to?
Cheers!
Code:
Sub SendEmails()
Dim aOutlook As Object
Dim aEmail As Object, x As Long
Dim rngeAddresses As Range, rngeCell As Range, strRecipients As String
Dim lngCount As Long
Dim strdate As Date, strtitle As String, StrSource As String, strOutput As String
Dim strImage As String, strImage2 As String
Dim colAttach As Object
Dim oAttach As Object
'Set Variables
strUNC = "PATH FOR WHERE THE FILE IS KEPT"
StrSource = "SHEET_1"
strtitle = "SHEET_2"
'Set File Name
strOutput = "NAME_OF_FILE"
'Debug.Print strOutput
strOutput = strUNC & strOutput
'Set the date for the email title
strdate = Worksheets(strtitle).Range("I8").Value
'set outlook
Set aOutlook = CreateObject("Outlook.Application")
Set aEmail = aOutlook.CreateItem(0)
'set Importance
aEmail.Importance = 2
'Set Subject
aEmail.Subject = "SUBJECT"
'Set Body for mail
aEmail.body = "Please log onto the MIS v2 system to check status (( Indicator List))"
aEmail.Attachments.Add strOutput
aEmail. ???????
End Sub