Jump to content
Sign in to follow this  
anixon

ObjCreate("Outlook.Application")

Recommended Posts

anixon

Before running this code:

CODE
#include <IE.au3>

Global Const $olFolderInbox = 6

$sSender = "anyone@anywhere.net.au"

_IEErrorHandlerRegister()

$o_Outlook = ObjCreate("Outlook.Application")

$oNameSpace = $o_Outlook.GetNameSpace("MAPI")

$oInbox = $oNameSpace.GetDefaultFolder($olFolderInbox)

$oFolders = $oInbox.Parent.Folders

While 1

$oItems = $oInbox.Items

For $oItem In $oItems

If String($oItem.SenderEmailAddress) = $sSender Then

msgbox(0,"","New Email Found " & $oItem.Subject,2)

;ExitLoop(2)

EndIf

Next

Sleep(2000)

WEnd

msgbox(0,"","Not Found Yet",1)

1 is it possible to force Outlook to perform a Send/Receive as part of the process created by ObjCreate("Outlook.Application")? and

2 is there a requirement to release the Outlook.Application object after the process performed by it completed and if so how would that be achieved?

Assistance is always appreciated... Ant.. ;)

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  

×