G
Guest
I am using the following code to automate an email message from Access. I
would like to automatically update fields on a form in Access witha time
stamp to confirm when the message was sent. I would also like the email
message to display before it is sent.
I can easily make the form in Access update automatically, however, it will
be possible for the user to cancel the message, in which case the form should
not be stamped because no message ws sent. Unfortunately, though, when I
create the email message in the code, the code keeps running. I am basically
looking for the best place, or best way to evaluate that a message was sent.
So that if the user cancels the message, then the form does not update.
Is there any way to halt execution? Or pause before the user either sends or
aborts the message?
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.To = em
.Subject = stext
.Body = mtext
.Display
End With
would like to automatically update fields on a form in Access witha time
stamp to confirm when the message was sent. I would also like the email
message to display before it is sent.
I can easily make the form in Access update automatically, however, it will
be possible for the user to cancel the message, in which case the form should
not be stamped because no message ws sent. Unfortunately, though, when I
create the email message in the code, the code keeps running. I am basically
looking for the best place, or best way to evaluate that a message was sent.
So that if the user cancels the message, then the form does not update.
Is there any way to halt execution? Or pause before the user either sends or
aborts the message?
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.To = em
.Subject = stext
.Body = mtext
.Display
End With