yogithite
asked on
Script to Get count of new mails in Outlook
Hi,
I need to write a VB Script or VC++ program to get total number of new emails in outlook. Can anyone tell me or point me at suitable code/documentation?
Thanks in Advance,
Y
I need to write a VB Script or VC++ program to get total number of new emails in outlook. Can anyone tell me or point me at suitable code/documentation?
Thanks in Advance,
Y
ASKER
Thanks for info bp...
What does SERVERNAME and MAILBOXNAME stand for? is it the IP of server and mail client name?
cscript ProcessNotesEmails.vbs SERVERNAME MAILBOXNAME
What does SERVERNAME and MAILBOXNAME stand for? is it the IP of server and mail client name?
cscript ProcessNotesEmails.vbs SERVERNAME MAILBOXNAME
ASKER
+ one more thing,
I want to run this script on the client side. My mail server is hMailServer. Asif now, I am trying to write the script w.r.t. http://www.hmailserver.com/documentation/latest/?page=com_objects
Y
I want to run this script on the client side. My mail server is hMailServer. Asif now, I am trying to write the script w.r.t. http://www.hmailserver.com/documentation/latest/?page=com_objects
Y
ASKER
I was able to write/get code for getting unread mails in Inbox.
This attached script is limited only to get unread mails from Inbox - and not from Sub folders.
Can anyone help me to update this script to traverse through sub folders and get count of unread mails?
Any help is appreciated, Thanks in Advance.
This attached script is limited only to get unread mails from Inbox - and not from Sub folders.
Can anyone help me to update this script to traverse through sub folders and get count of unread mails?
Any help is appreciated, Thanks in Advance.
' *****************************************************
' Script To Display Unread Outlook Mail Items *
' *
' *****************************************************
Dim objOutlook
Dim objNameSpace
Dim objFolder
Dim CurrentItem
Dim Count
Const olFolderInbox = 6
Set objOutlook = CreateObject("Outlook.application")
Set objNameSpace = objOutlook.GetNameSpace("MAPI")
Set objFolder = objNameSpace.GetDefaultFolder(olFolderInbox)
For Each CurrentItem in objFolder.Items
If CurrentItem.Unread then
Count = Count+1
End If
Next
Msgbox("Unread Messages in Inbox:" &Count)
' **** Clean up
'
Set objFolder = Nothing
Set objNameSpace = Nothing
set objOutlook = Nothing
Take a look at this post.
https://www.experts-exchange.com/questions/22995423/Loop-Through-Outlook-Folders-using-vba.html
~bp
https://www.experts-exchange.com/questions/22995423/Loop-Through-Outlook-Folders-using-vba.html
~bp
ASKER
Hi bp, Again, thanks for your input.
Code which you are pointing at is VBA code and I need VBS script. Fact is - I dont know VBA and macros and many other things. I am newbie to all this coding work. I am managing somehow with VB Script in critical time.
I would appreciate if anyone helps me out for completing above script for traversing through sub folders and get count of unread mails?
Regards,
Y
error.jpg
Code which you are pointing at is VBA code and I need VBS script. Fact is - I dont know VBA and macros and many other things. I am newbie to all this coding work. I am managing somehow with VB Script in critical time.
I would appreciate if anyone helps me out for completing above script for traversing through sub folders and get count of unread mails?
Regards,
Y
error.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks alot bp for your kind help!! I really appreciate your help.
Yogi
Yogi
ASKER
Hi ,
is there any way to update this same script for getting sync complete notification?
is there any way to update this same script for getting sync complete notification?
You might take a look at this thread. Your question is quite a bit different though than what this current question was about, just counting unread emails. Trapping sync complete events is more complex.
https://www.experts-exchange.com/questions/24897422/Detect-completion-of-Outlook-Send-Recieve.html
~bp
https://www.experts-exchange.com/questions/24897422/Detect-completion-of-Outlook-Send-Recieve.html
~bp
http://www.tek-tips.com/viewthread.cfm?qid=1147829&page=1
~bp