Hi All
I am working on a macro for an Email that will send some request to recipients. We are scrubbing the data on the responses so need them to respond in a certain way. I am trying to get the templates to auto-populate in the return email. I currently have the below coded up which is giving me some rudimentary hyperlinks and the subject line as "Full".
My goal list is as follows:
Have professional looking buttons instead of hyperlinks
Auto-populate Template on return Email
Include cc group
Notes
Using %0d as line breaks for the template email. Not sure if that is right.
Code Below:
Sub macTestEmail()
Dim App As Outlook.Application
Dim NewMail As MailItem
Dim MailTo As String
Dim MailCC As String
Dim TheSubject As String
Dim TheBody As String
MailTo = ""
MailCC = ""
TheSubject = "Test Email"
TheBody = "<HTML><BODY>"
TheBody = TheBody & "Please use one of the below links to respond to ... today:"
TheBody = TheBody & "<br>"
TheBody = TheBody & "<br>"
TheBody = TheBody & "<A href=mailto:abc@xyz.com?Subject=Full Agree To The Test&Body=To fully agree ...%0dLine 1:%0dLine 2:%0dLine 3:%0dLine 4:>Full Agree</A>"
TheBody = TheBody & "<br>"
TheBody = TheBody & "<br>"
TheBody = TheBody & "<A href=mailto:abc@xyz.com>Partial Agree</A>"
TheBody = TheBody & "<br>"
TheBody = TheBody & "<br>"
TheBody = TheBody & "<A href=mailto:abc@xyz.com>Full Dispute</A>"
TheBody = TheBody & "</BODY></HTML>"
Set App = CreateObject("Outlook.Application")
Set NewMail = App.CreateItem(olMailItem)
NewMail.To = MailTo
NewMail.CC = MailCC
NewMail.Subject = TheSubject
NewMail.HTMLBody = TheBody
NewMail.Display
'NewMail.Send
End Sub
I am working on a macro for an Email that will send some request to recipients. We are scrubbing the data on the responses so need them to respond in a certain way. I am trying to get the templates to auto-populate in the return email. I currently have the below coded up which is giving me some rudimentary hyperlinks and the subject line as "Full".
My goal list is as follows:
Have professional looking buttons instead of hyperlinks
Auto-populate Template on return Email
Include cc group
Notes
Using %0d as line breaks for the template email. Not sure if that is right.
Code Below:
Sub macTestEmail()
Dim App As Outlook.Application
Dim NewMail As MailItem
Dim MailTo As String
Dim MailCC As String
Dim TheSubject As String
Dim TheBody As String
MailTo = ""
MailCC = ""
TheSubject = "Test Email"
TheBody = "<HTML><BODY>"
TheBody = TheBody & "Please use one of the below links to respond to ... today:"
TheBody = TheBody & "<br>"
TheBody = TheBody & "<br>"
TheBody = TheBody & "<A href=mailto:abc@xyz.com?Subject=Full Agree To The Test&Body=To fully agree ...%0dLine 1:%0dLine 2:%0dLine 3:%0dLine 4:>Full Agree</A>"
TheBody = TheBody & "<br>"
TheBody = TheBody & "<br>"
TheBody = TheBody & "<A href=mailto:abc@xyz.com>Partial Agree</A>"
TheBody = TheBody & "<br>"
TheBody = TheBody & "<br>"
TheBody = TheBody & "<A href=mailto:abc@xyz.com>Full Dispute</A>"
TheBody = TheBody & "</BODY></HTML>"
Set App = CreateObject("Outlook.Application")
Set NewMail = App.CreateItem(olMailItem)
NewMail.To = MailTo
NewMail.CC = MailCC
NewMail.Subject = TheSubject
NewMail.HTMLBody = TheBody
NewMail.Display
'NewMail.Send
End Sub