Thanks djxtreme.
Does anyone else know of a way to do this?
Thanks,
Jono
Main Topics
Browse All TopicsI found this VB Macro that allows me to do a Gmail-type archive of my mail, and it works great. However, I have more than one Exchange mailbox in my Outlook and I'd like to have the macro move an item to a different folder depending on which mailbox the selected item is in. I know nothing of VB, so I need your help on this.
I have 2 relevant mailboxes:
Mailbox - Jono Martin (primary/default)
Mailbox - IT Support
Currently, I have a folder inside Mailbox - Jono Martin called "All Mail". When I hit the button to run the macro, it moves the selected email to that folder.
I tried creating another macro and changing the folder name in the macro to a folder in Mailbox - IT Support, but I got an error stating that the folder could not be found. This led me to believe that it only looks in Mailbox - Jono Martin for the folder name.
Ideally, I'd like the single macro to act as follows:
If the selected email is in:
Mailbox - Jono Martin -- move it to the "All Mail" folder that is in the same mailbox.
If the selected email is in:
Mailbox - IT Support -- move it to the "All IT Mail" folder that is in the IT Support mailbox.
If that's not possible, I'd like to have a separate macro to move the selected item to the "All IT Mail" folder under the IT Support mailbox.
Thanks for all your help.
Jono
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: djxtremePosted on 2009-03-27 at 06:05:22ID: 24000393
Changing olFolderInbox wont help at all, as the function (GetDefaultFolder) is looking for a folder type (not name)
I had a quick flick through the MS Office VB site, and can't see a way of calling a secondary mailbox, only way's to call the default.
If you could (however) gain the EntryID and StoreID for the second Inbox, you could do a GetFolderFromID. However to get the ID MS suggest that you use GetDefaultFolder, which brings us back to the first issue.
Any other VB experts may know some other trick, but I suspect it may not be simple :)