I've created a macro in Excel to create and display a new email with the BCC, Subject, and Body fields filled with data from specific cells in the excel worksheet. It's basic and gets the job done.
I have a plugin called "Smart Email" added to Outlook that when used to send an email, keeps track of open rates and click rates of the "smart emails" I send. I'd like the VBA macro to create a "smart email" and not just a regular email.
How would I look up the object name of a addin or plugin in Outlook? For example, is there a smart email (the add-in) object code that I could swap in for the standard new outlook email “emailApplication.createitem(0)” line item? Or, do default microsoft items only show in the object library?
Sub CreateEmail()
'Set the variables:
Dim emailApplication As Object
Dim emailItem As Object
Set emailApplication = CreateObject("Outlook.Application")
Set emailItem = emailApplication.createitem(0)
'To build the email. The body text, email addresses and subject line are saved in the excel cells listed below:
With emailItem
.Body = Range("D17")
.BCC = Range("D15")
.Subject = Range("D16")
.Display
End With
End Sub