Creating Call To Action Button Inside Outlook Email That Creates Template For Recipient To Complete

aruen

New Member
Joined
Aug 26, 2013
Messages
10
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
 

Attachments

  • Email Pic 1.PNG
    Email Pic 1.PNG
    11.2 KB · Views: 50
  • Email Pic 2.PNG
    Email Pic 2.PNG
    6.8 KB · Views: 49

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
added singular quotes around the inside which worked to fix my problem

<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>"
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,150
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top