Discussion:
Archive Mail Item directly after clicking the "Send" button
(too old to reply)
unknown
2009-12-30 23:08:48 UTC
Permalink
My "Sent Items" contains a lot of junk and some items to keep/store. After cleaning up, I'm working on a macro to ask me after clicking the send button if I want to DELETE the mail. If yes, the mail should be stored in a subfolder ("deleted") to the "Sent Items" (mySentDel).

MyMail.Send
MyMail.Move mySentDel

Looks like Outlook can't send it quick enough before the next line of the code moves the item. Error message:
"The operation cannot be performed because object has been deleted."

Any suggestions?


Submitted via EggHeadCafe - Software Developer Portal of Choice
Delegates to the Event, Part II - Events
http://www.eggheadcafe.com/tutorials/aspnet/c662bbc8-dc09-4c7e-91f0-a8f9d9bb9730/delegates-to-the-event-p.aspx
Dmitry Streblechenko
2009-12-31 07:02:05 UTC
Permalink
Instead of explicitly moving the message, set the SaveSentMessageFolder
property before sending the message:

MyMail.SaveSentMessageFolder = mySentDel
MyMail.Send
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Post by unknown
My "Sent Items" contains a lot of junk and some items to keep/store. After
cleaning up, I'm working on a macro to ask me after clicking the send
button if I want to DELETE the mail. If yes, the mail should be stored in
a subfolder ("deleted") to the "Sent Items" (mySentDel).
MyMail.Send
MyMail.Move mySentDel
Looks like Outlook can't send it quick enough before the next line of the
"The operation cannot be performed because object has been deleted."
Any suggestions?
Submitted via EggHeadCafe - Software Developer Portal of Choice
Delegates to the Event, Part II - Events
http://www.eggheadcafe.com/tutorials/aspnet/c662bbc8-dc09-4c7e-91f0-a8f9d9bb9730/delegates-to-the-event-p.aspx
Loading...