picea892 Posted February 7, 2009 Share Posted February 7, 2009 Hi everyone I was wondering if someone could point me in the right direction for converting this vbs script to autoit. I'm sure there must be a way. The script will return the number of outlook unread messages. Thanks in advance for the help. Set otl = createobject("outlook.application") Set session = otl.getnamespace("mapi") session.logon Set inbox = session.getdefaultfolder(6) c = 0 For Each m In inbox.items If m.unread Then c = c + 1 Next session.logoff s = "s" If c = 1 Then s = "" msgbox c & " unread message" & s Link to comment Share on other sites More sharing options...
picea892 Posted February 7, 2009 Author Share Posted February 7, 2009 I seem to have it. Sorry for the preemptive post, it was rather simple really. $otl = ObjCreate("Outlook.Application") $session = $otl.GetNameSpace("MAPI") $inbox = $session.GetDefaultFolder(6) $c=0 For $m In $inbox.items If $m.unread Then $c = $c + 1 Next $session.logoff $s = "s" If $c = 1 Then $s = "" msgbox (0,"",$c & " unread message" & $s,10) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now