Hi,
Is it possible to write a VBA/Macro that will populate the subject line of a new email, if the recipients belongs to a specific email address?
For example, if the recipient is "John Smith" and his email address "[email protected]," the subject line will populate with a text "Report"
I wrote a code but not sure if it is correct. Please let me know you thoughts on how I can improve it. Thank you!
Sub SubjectLine()
Dim myItem As Outlook.MailItem
Dim myRecipient As Outlook.Recipient
Set myItem = Application.CreateItem(olMailItem)
If myRecipient = "John Smith" then
myItem.Subject = "Report"
myItem.Display
End If
set myItem = Nothing
End Sub
Bookmarks