Help with simple macro - looping though all emails in my inbox

Status
Not open for further replies.

dalep

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Hello,

I'm trying to write a simple script to open and close, one-by-one, all 6,000+ emails in my outlook inbox! This will retrieve them all from my company archive to my local machine, where I often work offline and need access.

I had started opening these emails manually (in batches of 50 emails) but a friend has said I can automate this process with a macro script. I know this must be a simple operation in VB, but I don't know where to start! My google searches have found nothing that I can make sense of!! (albeit I come from a php background)

This is the process that I would like to learn how to loop through:

1. Take the first email in my inbox

2. Open it (by performing the same action as double-clicking the email sender and subject)

3. Wait for email to be retrieved from the archive and appear in a new message window

4. Close the message window and move onto the next email

Any help, pointers would be greatly appreciated. Thanks a lot in advance.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
This one is not quite what you want, but should do the trick - Saving All Messages to the Hard Drive Using VBA - Slipstick Systems - it might be better than opening because you don't need to work in a timer function. Delete the folder from the hard drive when finished... or use it as your offline archive. (I'll see if i can find some code that will do the open & close.)
 

dalep

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
This one is not quite what you want, but should do the trick - Saving All Messages to the Hard Drive Using VBA - Slipstick Systems - it might be better than opening because you don't need to work in a timer function. Delete the folder from the hard drive when finished... or use it as your offline archive. (I'll see if i can find some code that will do the open & close.)

Thanks so much for that Diane. I've run the script but unfortunately it just saves each message in its current state, without retrieving them for the archive - i.e. each message contains this text: "The original message has been archived. Click the following link to retrieve it".

It's only when I double click message (either in outlook, or now the messages folder in explorer) that it retrieves it.

Is there a way I could modify the code to open and close each message in turn? Or perhaps there is a script I could use in explorer to loop through opening each file within a folder?
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I'll look into it - i thought for sure that saving the message would download a full copy.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
C Need Help with Simple Code Correction Using Outlook 11
S HTML to Plain Text Macro - Help Outlook VBA and Custom Forms 1
e_a_g_l_e_p_i Outlook 2010 Help setting up Gmail account in Outlook 2010 Using Outlook 3
N Help creating a VBA macro with conditional formatting to change the font color of all external emails to red Outlook VBA and Custom Forms 5
Y Filter unread emails in a search folder vba help Outlook VBA and Custom Forms 0
L Need help modifying a VBA script for emails stuck in Outbox Outlook VBA and Custom Forms 6
F Microsoft Outlook Connector 14.0.6123.5001 - Help! Using Outlook 6
witzker Pls help to change the code for inserting date in Ol contact body Outlook VBA and Custom Forms 5
R Disable conversation thread from replying of recipients in the same subject. Please help Using Outlook 0
R seperate read layout to design in outlook 2016..Help!! Outlook VBA and Custom Forms 3
O Help .. got lost ... installing Office like 2016 Using Outlook 5
A Arthur needs help with 2007 Outlook e-mail Using Outlook.com accounts in Outlook 3
R Help Revising VBA macro to delete email over different time span Outlook VBA and Custom Forms 0
Marc2019 Need help please! Cannot Setup my outlook email account on my Mac Outlook 2011 Using Outlook.com accounts in Outlook 2
L Attachment saving and tracking - PLEASE help! Outlook VBA and Custom Forms 5
I Help with dates in task list. Using Outlook 5
C need help setting up outlook first time Using Outlook 1
K To do bar help Using Outlook 8
M Help sending email but removing signature via VBA Outlook VBA and Custom Forms 5
S help with outlook scripting Outlook VBA and Custom Forms 4
J Help Please!!! Outlook 2016 - VBA Macro for replying with attachment in meeting invite Outlook VBA and Custom Forms 9
EmelineGueguen Help to understand the problem of work Using Outlook 1
N Outlook Forms Help Outlook VBA and Custom Forms 2
N Need help syncing contacts to iPhone X Using Outlook 8
S VBA Macro - Run-time error '424': object required - Help Please Outlook VBA and Custom Forms 3
broadbander Needing help with reply/reply all while keeping attachments and adding a new CC recipient. Outlook VBA and Custom Forms 5
J Help! My contacts have disappeared. Using Outlook 5
J HELP- Rule to auto strip prepend from external emails Using Outlook 0
J Help Needed With Multi-Step Login Email Address Using Outlook.com accounts in Outlook 1
G Bcc help - Preventing multiple forwards from a bcc'd distribution group Using Outlook 1
G [Help] Converting array to destination folder path Outlook VBA and Custom Forms 1
K Help.... Office Outlook 2016 Using Outlook 1
S Error using AddressEntry.GetContact - need help Outlook VBA and Custom Forms 2
D Help with code to move mail on receipt to another folder based on time received Outlook VBA and Custom Forms 2
E Outlook 2010 need help with rules Using Outlook 0
B HELP! Using Outlook 4
Jeff Davis Help fix my Outlook 2013? Using Outlook 28
M Winmail. dat - HELP Using Outlook 2
Diane Poremsky Help! My Contacts are being updated! Using Outlook 0
B VBA Help Email that will save as draft and send as attachment Outlook VBA and Custom Forms 3
J Can Anyone Help?? Outlook VBA and Custom Forms 1
C Newbie needs help with Outlook Macro Outlook VBA and Custom Forms 3
B Need Help - Willing to pay Outlook VBA and Custom Forms 10
D help with Item/Inspector close event Outlook VBA and Custom Forms 1
G Looking for help with our Organization Forms Library Outlook VBA and Custom Forms 1
J Need Help with Contacts VBA Outlook VBA and Custom Forms 1
L Outlook 2002: HTML Emails Will Not Print: Please Help Using Outlook 0
H Need help setting up GetFolderPath-Makro with Vodafone IMAP Mail-Account Outlook VBA and Custom Forms 0
A newb outlook macro help Outlook VBA and Custom Forms 1
T Need help with finding/updating task Outlook VBA and Custom Forms 1

Similar threads

Top