Not a question, just something I've put together to solve an issue we've had at work which I thought I'd share.
I have multiple mailboxes on my Outlook account and am able to send items either from myself or on behalf of any of them. The problem was that all sent items were being stored in my sent items not the ones relating to the other mailboxes. This made keeping an audit trail difficult and meant I had to manually remember to copy the items I'd sent on behalf of another mailbox into the correct folder which was a pain.
The following code checks if an email has been sent on behalf of another mailbox and if so moves it into the correct one. All our mailboxes are called "Mailbox - mailbox name" which I'm not sure if is standard as I'm pretty new to using Outlook. The code would need amending if your mailboxes are differently named.
The code needs to be placed on the ThisOutlookSession of your Outlook VBA Project.
I'm new to coding in Outlook and not an expert so there may be issues I've not picked up.
Hope it helps someone anyway.
Dom
![]()
Please Login or Register to view this content.
Edits:
Changed code to use Application_MAPILogonComplete rather than Application_Startup as it can be a bit flaky
Also realised it was moving all sent mail to the correct Sent Mail folder so updated to avoid processing mail sent from the default mailbox.
Bookmarks