Hello,
I am tryingo to write macro that sends an auto email everytime the user clicks a button, i found some code for this part but i also need to be able to send the e-mail to a specific person based on what is selected on cell D4 as well as to giv ethe user the oportunity to add any context on hte bopdy of the e-mail.
I am tryingo to write macro that sends an auto email everytime the user clicks a button, i found some code for this part but i also need to be able to send the e-mail to a specific person based on what is selected on cell D4 as well as to giv ethe user the oportunity to add any context on hte bopdy of the e-mail.
Code:
Sub DoALLsingle()
'Dim Sourcewb As Workbook
Dim Destwb As Workbook
Dim Mail_Object, Email_Subject, o As Variant
Set Destwb = ActiveWorkbook
Set Mail_Object = CreateObject("Outlook.Application")
With Mail_Object.CreateItem(o)
.Subject = " Request" ' CHANGE TO SUIT
.To = "sss@ddd.com" 'CHANGE TO SUIT
'.Body = "E MAIL TEXT GOES HERE" & Chr(13) & Chr(13) & "Regards," & Chr(13) & "YOUR NAME." & Chr(13) & "YOUR ADDRESS." 'Change comments to suit
.Attachments.Add Destwb.FullName
.Body = "Thank you" & Chr(13) & Chr(13) '& "Regards," & Chr(13) & "YOUR NAME." & Chr(13) & "YOUR ADDRESS." 'Change comments to suit
'.send
End With
'MsgBox "E-mail successfully sent", 64
'Application.DisplayAlerts = False
Set Mail_Object = Nothing
Cells.Select
Selection.EntireRow.Hidden = False
Range("E11:I31,E9,G33:I33,E4").Select
Range("E4").Activate
Selection.ClearContents
'ActiveWorkbook.Save
'ActiveWorkbook.Close
End Sub