Hi All,
I have code, similar to the following, that I would like to modify:
Sub SendEmail()
Dim myOlApp As Outlook.Application
Dim myItem As Outlook.MailItem
'Create an Outlook application object
Set myOlApp = New Outlook.Application
'Create a new MailItem form
Set myItem = myOlApp.CreateItem(olMailItem)
'Build and display item
With myItem
.To = “[email protected]”
.Subject = “Test Subject”
.HTMLBody = “Test Body”
.Display
.SaveAs “C:\Test.msg”, olMSG
End With
End Sub
This code is called from various buttons throughout the application. When a button is clicked, a new email is created and saved. Unfortunately, the email is saved as soon as it is created and BEFORE it is sent... so, if any modifications are made to it, they will not be in the saved version.
What can I do to modifiy this code to ONLY save the email once it has been sent?
Feel free to ask any followup questions as necessary and I will respond as best I can.
Thanks!
Robert