10-10-2009, 09:39 AM
use a loop to go through all the folders, and find your personal folder.
see the code below
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