Jump to content

Outlook VBS-AU3


 Share

Recommended Posts

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...