SysExpert
asked on
Need script to give name and count of email in all outlook folders to a text file
I am trying to find some missing emails by comparing PST backups. Apparently some emails may have been moved accidentally, and I need a count of All emails per folder, with name of folder, and count output to a text file.
This should include not just inbox folders, but everything.
I am normally a Lotus NOTES and Excel scripter, so I can't quite figure this one out.
similar scripts that do part of it
https://www.experts-exchange.com/questions/22959025/Need-to-get-the-Count-according-to-subject-from-outlook-mails.html
http://blogs.technet.com/kclemson/archive/2007/08/01/count-the-number-of-folders-in-your-mailbox-with-outlook-vba.aspx
Thanks !
This should include not just inbox folders, but everything.
I am normally a Lotus NOTES and Excel scripter, so I can't quite figure this one out.
similar scripts that do part of it
https://www.experts-exchange.com/questions/22959025/Need-to-get-the-Count-according-to-subject-from-outlook-mails.html
http://blogs.technet.com/kclemson/archive/2007/08/01/count-the-number-of-folders-in-your-mailbox-with-outlook-vba.aspx
Thanks !
ASKER
Thanks for the help !
I get an error on line 8
get Run-time error '438';
Object doesn't support this property or method
Using outllook 2003 SP3 on Exchange 2003 , fully patched
Running from outlook client.
Can you please test again ?
Thanks !
I get an error on line 8
get Run-time error '438';
Object doesn't support this property or method
Using outllook 2003 SP3 on Exchange 2003 , fully patched
Running from outlook client.
Can you please test again ?
Thanks !
That code is for Outlook 2007 not 2003. Apologies, since no version was specified I wrote for the latest version. I'll see about making changes to get it to work from 2003 and post again.
ASKER
found this
http://www.microsoft.com/technet/scriptcenter/resources/qanda/jun06/hey0616.mspx
but it does not work either.
The 2 I have listed in my first post, sem to work, but do not give me the info I want ( only folder count, not items in the folder )
Thanks !
http://www.microsoft.com/technet/scriptcenter/resources/qanda/jun06/hey0616.mspx
but it does not work either.
The 2 I have listed in my first post, sem to work, but do not give me the info I want ( only folder count, not items in the folder )
Thanks !
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great !
WOrks perfectly !
WOrks perfectly !
Cool!
This should do it. Follow these instructions to use this.
1. Start Outlook
2. Click Tools > Macro > Visual Basic Editor
3. If not already expanded, expand Microsoft Office Outlook Objects and click on Module1
4. Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
5. Edit the code as needed. I included comments wherever something needs to or can change
6. Click the diskette icon on the toolbar to save the changes
7. Close the VB Editor
8. Run the macro CountMessages
Open in new window