Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"The item has been moved or deleted" error when using sent property

Status
Not open for further replies.

kriehn16

Technical User
Jul 1, 2008
18
0
0
US
I am trying to verify that an email was sent but when I use the mailitem.sent property I get the following error: "The item has been moved or deleted." I noticed that before I send the email the sent property is "False" but after it is sent it changes to the error above. Does anyone know how to get this property to return either "True" or "False" after the email has been sent?

Thank you,

joker16
 
Following is my code:

Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment

'Create Outlook session
Set objOutlook = CreateObject("Outlook.Application")

'Create the message
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg
emailrecip(0) = email_to(0)

Set objOutlookRecip = .Recipients.Add(emailrecip(0))
objOutlookRecip.Type = olTo

.Subject = "ZFERT: " & zfert(0) & ", S.O. " & so & ", " & customer

.Body = vbCrLf & "This ZFERT is to be routed per the ZFERT email process."

.Send

email_sent = .Sent

joker16
 
Where is email_sent defined?

Beir bua agus beannacht!
 
Dim email_sent As Boolean

It is defined right above the the other definitions at the top of the code. Sorry, I forgot to include it.

joker16
 
I just cobbled together a Q&D Outlook app and am getting the same behavior (Outlook 2000). I'll look deeper & get back to you. Seems pretty odd since the property is a Boolean. I've never seen a property lose scope like this before.

Beir bua agus beannacht!
 
Well, joker16, I didn't run across any mention of our little problem. The .Submitted property does the same thing, and if I test for Is Nothing I get error 13 type mismatch. It looks like others are checking on success by monitoring Sent Items and Outbox folders. Here are some links to help with that approach:





Post back if you find anything out - this one has me stumped.

Beir bua agus beannacht!
 
I have not been able to find anything yet, but I am still searching. Thank you for looking into this for me and for the links.

joker16
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top