Hello,
I am creating a database and am relatively new to VBA.
I have written function to create and send an email with outlook. After the email is created it is displayed using
objOutlookMsg.Display
where objOutlookMsg is a outlook.MailItem declared at the start of the function.
If the user actually sends the message I need to carry out another action within the database. If they don't actually send the message, I don't want to carry out that action.
I can see that there is a .sent property for MailItems but if I test for this it always comes back False - presumably because once the email is gone (either by sending or closing it), it's gone and I can't check that property.
How can I catch whether the email was sent or not?
Many thanks.
Bear.
I am creating a database and am relatively new to VBA.
I have written function to create and send an email with outlook. After the email is created it is displayed using
objOutlookMsg.Display
where objOutlookMsg is a outlook.MailItem declared at the start of the function.
If the user actually sends the message I need to carry out another action within the database. If they don't actually send the message, I don't want to carry out that action.
I can see that there is a .sent property for MailItems but if I test for this it always comes back False - presumably because once the email is gone (either by sending or closing it), it's gone and I can't check that property.
How can I catch whether the email was sent or not?
Many thanks.
Bear.