Outlook Object Model via Excel -- return code after send?

G

Guest

I use the following OUTLOOK Object Model code to email sheets to users. I
need to know if the sender actually sent the email.

I know how to get a return code using the SENDMAIL model, but I need to
modify the body of the message. I have searched all documentation that I
have, or have been able to find, including searching the OUTLOOK community
Q&A's.

Can a return code be sent back that tells me if the sender actually sent the
email?


Thanks regards,
Gary

‘
‘Send email
‘
With OutMail
.To = "(e-mail address removed)"
.CC = ""
.BCC = ""
.Subject = "Ron, Thank you for making your code samples public!"
.Body = Modified_message_based_on_sheet_content
.Attachments.Add archivename
.Display
End With

If emailsent then
LogTheEmailSent
Else
Msgbox “email was not sent!â€
endif
 
D

David Sisson

In my Outlook 2000 book, in a paragraph describing canceling an
event...

"...when an event is cancelled, the event still fires, but the
consequences of the event is cancelled. For example, if the user
failed to enter data in the required field LastName, the 'Write' event
can be used to warn the user and cancel the saving of the edited item,
as we see in the code in Listing 4-14.

Function Item_Write()
if Item.LastName = "" then
msgbox "Need to enter last name"
Item_write = False
end if

End Function
'end quote

So perhaps some code in the send event (not tested)

Function Item_Send
If Item_Send = false then
Answer = Msgbox "Do you really want to cancel the Save?"
If Answer = 1 then
Item_send = false
else
Item_Send = True
end if
end if
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top