Counting Word Occurrences


I put this solution together for a reader named Rakesh. Rakesh asked for a solution that counts the number of times certain words occur in Outlook messages received within a given date range. The list of words he wants to count are in column B of a spreadsheet, one word per row. Rakesh wants the counts to appear next to the words in column C. Here’s how Rakesh will use the solution.

  1. Select the Outlook folder containing the messages he wants to process
  2. Run the macro
  3. Enter the path and file name of the Excel workbook containing the words he wants to count for
  4. Enter a date range.

The macro scans every message in the selected folder that arrived within the date range he entered. The code scans each message for every word in the workbook and write the counts to the spreadsheet. Continue reading