Sign in to follow this  
Followers 0
picea892

Outlook VBS-AU3

2 posts in this topic

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

Share this post


Link to post
Share on other sites



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)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0