Yes, Outlook doesn't seem to see closing the compose window as a bad thing so it closes the routine without a hitch - not great for me because I want to put an IF should the user do that at the time.Then it is not a problem that needs to be addressed. You are creating an object. As long as the sub routine can finish what it needs to do, there won't be a problem. If you had additional lines that said to have the object open and then come minimize and then change color and then maximize, etc - the user would have an opportunity to interrupt the code from executing.
This is why the DoCmd Sendobject can fail to fully execute. It is committed to sending the object.
I guess you could look into the Outlook sent folder and hunt down the email to make sure they sent it. I haven't written any code to try and do it but I know there are examples out there.
It's something I could do I just fret about whether the user will do something that messes with the outcome.
I use this to display then send, what you ask is outside of access it's inside outlook, I've never needed to do this but you may try looking at the VBA Object browser, and select outlook from the list, you may find something here to help or point you in the right direction. i'm sure that you need to use outlook vba reference once the email is displayed, the same way you use .display .send and so on. Or you could try an outlook VBA forum, the code should be adaptable for access the same way you manipulate excel from access.
Dim lst As Form
Dim vItem As Variant
Dim iLen As Integer
Dim swhare
Dim myOlApp As New Outlook.Application
Dim myItem As Outlook.MailItem
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olmailItem)
With myItem
For Each vItem In Me.Employees1
If Not IsNull(vItem) Then
myItem.Attachments.Add lst.ItemData(vItem)
End If
Next
Set lst = Nothing
End With
myItem.To = Forms![main menu]![Employees1]![E-Mail Address]
myItem.Display
1000 ways to skin a cat, allways looking for another one...
Use MDB format for sample post. If your issue is fixed, mark the thread solved.
Click on the star below if this has helped.