D
DEI
I have used the .SendObject method in the past to automate Access and
Outlook, i.e. open an email message, populate it, etc. Works fine
However, I am in need of specifiying the 'From' field in the message, so I
am now creating a session, mail item, etc. and defining the
..SentOnBehalfOfName property. Works fine.
However, with the .SendObject method and error trapping, I was able to
determine whether the email was actually sent by the user, and then time
stamp a field in the database. Is there any way of confirming that the email
was sent using the Outlook.Application MailItem? I.e. with the code below?
Dim myOlApp As Outlook.Application
Dim myOlEmail As Outlook.MailItem
Set myOlApp = CreateObject("Outlook.Application")
Set myOlEmail = myOlApp.CreateItem(olMailItem)
Debug.Print myOlEmail.Sent
With myOlEmail
.Subject = "Test"
.To = "to email address"
.Body = "Body"
.SentOnBehalfOfName = "From email address"
.Display
End With
I am open to any ideas/solutions. I can not find away to accomplish both
tasks - populate the 'from' field and confirm that the email was sent, with
one approach.
Thanks,
DEI
Outlook, i.e. open an email message, populate it, etc. Works fine
However, I am in need of specifiying the 'From' field in the message, so I
am now creating a session, mail item, etc. and defining the
..SentOnBehalfOfName property. Works fine.
However, with the .SendObject method and error trapping, I was able to
determine whether the email was actually sent by the user, and then time
stamp a field in the database. Is there any way of confirming that the email
was sent using the Outlook.Application MailItem? I.e. with the code below?
Dim myOlApp As Outlook.Application
Dim myOlEmail As Outlook.MailItem
Set myOlApp = CreateObject("Outlook.Application")
Set myOlEmail = myOlApp.CreateItem(olMailItem)
Debug.Print myOlEmail.Sent
With myOlEmail
.Subject = "Test"
.To = "to email address"
.Body = "Body"
.SentOnBehalfOfName = "From email address"
.Display
End With
I am open to any ideas/solutions. I can not find away to accomplish both
tasks - populate the 'from' field and confirm that the email was sent, with
one approach.
Thanks,
DEI