Benjamin Bolduc
Registered User.
- Local time
- Today, 16:03
- Joined
- Jan 4, 2002
- Messages
- 169
Hi Folks,
I need to retrieve the count of emails in a shared exchange mailbox in Outlook 2010. I found the following software that retrieves the count I need, but only in default folders or ones that are 1 layer deep. The folder I need is two layers deep Mailbox -> Inbox -> Completed.
Is there anyway to drill down just one more level?
----------------------------------------
Const olFolderInbox = 6
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objInbox = objNamespace.GetDefaultFolder(olFolderInbox)
'strFolderName = objInbox.Parent
strFolderName = "benbolduc@gmail.com"
Set objMailbox = objNamespace.Folders(strFolderName)
Set objFolder = objMailbox.Folders("Inbox")
Set colItems = objFolder.Items
MsgBox objFolder.Name & " " & objFolder.Items.Count
End Sub
----------------------------------------
Any help would be greatly appreciated!
Ben Bolduc
I need to retrieve the count of emails in a shared exchange mailbox in Outlook 2010. I found the following software that retrieves the count I need, but only in default folders or ones that are 1 layer deep. The folder I need is two layers deep Mailbox -> Inbox -> Completed.
Is there anyway to drill down just one more level?
----------------------------------------
Const olFolderInbox = 6
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objInbox = objNamespace.GetDefaultFolder(olFolderInbox)
'strFolderName = objInbox.Parent
strFolderName = "benbolduc@gmail.com"
Set objMailbox = objNamespace.Folders(strFolderName)
Set objFolder = objMailbox.Folders("Inbox")
Set colItems = objFolder.Items
MsgBox objFolder.Name & " " & objFolder.Items.Count
End Sub
----------------------------------------
Any help would be greatly appreciated!
Ben Bolduc