Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script to count the number of mails in a given folder in Outlook
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
use a loop to go through all the folders, and find your personal folder.
see the code below
Code:
Set olApp = CreateObject("Outlook.Application")
Set olns = olApp.GetNameSpace("MAPI")
    For icnt = 1 To olns.Folders.Count
        If UCase(ns.Folders.Item(icnt)) = "<<YOUR PERSONAL FOLDER>>" Then '
            Set Folder = olns.Folders.Item(icnt)
            Exit For
        End If
    Next
msgbox Folder.Items.Count

Reply


Messages In This Thread
RE: Script to count the number of mails in a given folder in Outlook - by Saket - 10-10-2009, 09:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Extracting Email Body from Outlook waseem.khan.91 0 2,234 03-04-2019, 02:53 PM
Last Post: waseem.khan.91
  Extracting Email Body from Outlook waseem.khan.91 0 1,235 03-01-2019, 02:51 PM
Last Post: waseem.khan.91
  VB Script:number of times a character appears in a string with position Jyobtech 1 12,138 08-07-2013, 01:03 PM
Last Post: anil2u
  Creating a folder from within a reusable action. sd3 2 3,239 06-18-2013, 03:20 PM
Last Post: learnQtptips
  to count the number of used rows in a particular column sujaravi123 3 11,229 06-12-2013, 03:17 PM
Last Post: sujaravi123

Forum Jump:


Users browsing this thread: 1 Guest(s)