Consulting

Results 1 to 2 of 2

Thread: Solved: take a count of emails from a folders

  1. #1

    Solved: take a count of emails from a folders

    Hi,
    I have a folder called Inbox, and there are about 12 subfolders under that,
    Is there a way to get the count of all the emails in each folder?


    Arvind

  2. #2

    MAPIFolder

    Hey There.

    There is absolutely a way to do this. You'll want to add a function to your Outlook Module.

    You'll start by defining a variable of type MAPIFolder to access your Inbox. Next, you'll create a second variable of type MAPIFolder to access each subfolder. Also create a variable to store the total of each folder.

    You'll set your Inbox variable using GetDefaultFolder(olFolderInbox).

    Set your TotalCount variable equal to your Inbox's .Items.Count.

    Run a loop using a For Each subfolder In Inbox.Folders.

    Add your subfolder.Items.Count to your current TotalCount.

    Loop to the next subfolder.

    If you need more help, let me know.
    Scott

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •