-
Matt
I think I understand why my mail won't move but can't figure out a way to make it work
First the move does work when a mail enters the Sent folder. The code for this works because the mail isn't actually opened it's detected within the ThisOutlookSession Sub ItemsInSentFolder_ItemAdd. The code runs, the item is saved on the server and moved to the archive.
With the Inbox mails the way I initiate the Save & Move is to Open the mail and then Close it. The Close action is picked up in the clsCloseEvent Private Sub oMailItem_Close.
The problem is all the code runs before the mail actually closes. This was bypassed by an On Error Resume Next statement. Removing this Error catcher gives me a "Method 'Move' of Object 'MailItem' failed" statement.
What I need to know is Is there an "AfterMailClosed" event or some way to initiate further code after the Private Sub oMailItem_Close is finished?
What I may try is to put another button on the open e-mail toolbar to initiate the Close outside of the class module then run the code from here.
I've only just thought of that so that will be tommorows attempt.
Regards
Jeff T
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules