Richard
Sat Sep 09 11:12:15 CDT 2006
"Joe Fawcett" <joefawcett@newsgroup.nospam> wrote in message
news:eOAS2r$0GHA.4632@TK2MSFTNGP03.phx.gbl...
> "MN" <MN@nospam.com> wrote in message
> news:evxQSJ%230GHA.324@TK2MSFTNGP05.phx.gbl...
>> Hi...
>>
>> Is there any way to count items in an outlookfolder with a script.
>>
>> Please show me how.
>>
>> kindly
>>
>> Mariah
>>
> If you mean from outside Outlook then you need to get a reference to the
> folder and then the items.count. This Google message shows a similar
> script:
>
>
http://groups.google.co.uk/group/microsoft.public.scripting.vbscript/browse_thread/thread/8bff4579ad283d0d/6f4b0178f7327336?lnk=st&q=open+outlook+folder+group%3Amicrosoft.public.scripting.*&rnum=2&hl=en#6f4b0178f7327336
>
>
> --
>
> Joe Fawcett - MVP
>
>
http://joe.fawcett.name
>
Hi,
A quick example to display the number of messages in the Inbox:
===========
Option Explicit
Dim objOutlook, objNamespace, objFolder
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNamespace.GetDefaultFolder(6)
Wscript.Echo objFolder.Items.Count
--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab -
http://www.rlmueller.net