VBA script reads outlook mailbox

VBA script reads outlook mailbox

In one of our projects we needed to analyze email stored in outlook or office365 mailbox. We have written this utility in VBA that helped us do the job.

macro enabled workbook with vba script

Excel sample

Download this macro enabled spreadsheet: InboxCalculatorV3


VBA script reads outlook mailbox. Read outlook mail (you can specify which folder to process) into excel for further pivotting.

Selecting outlook inbox folder

Process of functionality


The results are written into Excel cells. You can adjust what is read and how it is written into Excel.

excel output of vba script

Results of VBA script

VBA script reads outlook mailbox

Simple and generic sourcecode to connect to an outlook mailbox (local or office365) and read mail.

VBA script to read outlook

VBA snippet

The sourcecode is free of use. Adjustments or improvements are always welcome. If you need support just leave a comment in this post.

Danny Riebeek

Danny is a SQL Enthusiast, always disovering new ways to leverage SQL Server functionality

View my other posts

One Comment on “VBA script reads outlook mailbox”

  1. Jim says:

    Hi Danny, like I’m the first, how can I mod this so it downloads unread mail only. I know I can use the DownloadState to filter out the ones to save but it takes forever to download them all every time

Leave a Reply