anixon Posted January 29, 2009 Posted January 29, 2009 (edited) In this code $0_outlook.quit does not close OUTLOOK.EXE opened by the process which means that you can get multiples of OUTLOOK.EXE running if this routine is run more than once. And following on from that is it necessary to delete the object created by the code after it has run and if so how is that achieved? CODE#include <IE.au3> $sSender = "anyone@anywhere.com" $sAnyoneFolder = "anyone" $o_Outlook = ObjCreate("Outlook.Application") $oNameSpace = $o_Outlook.GetNameSpace("MAPI") $oInbox = $oNameSpace.GetDefaultFolder(6) $oFolders = $oInbox.Parent.Folders $oAnyoneFolder = 0 For $oFolder In $oFolders If String($oFolder.Name) = $sAnyoneFolder Then $oAnyoneFolder = $oFolder EndIf Next ;Moves the email to the folder ; $oItems = $oInbox.Items For $oItem In $oItems If String($oItem.SenderEmailAddress) = $sSender Then $oItem.Move($oAnyoneFolder) msgbox(0,"",$oItem.body); Reads the body of the email EndIf Next $o_Outlook.quit Assistance is always appreciated Ant... Edited January 29, 2009 by anixon
Authenticity Posted January 29, 2009 Posted January 29, 2009 Write some line to the console or use MsgBox to inform that this code line reached because I've tried your script and it does close the OUTLOOK.EXE process.
anixon Posted January 29, 2009 Author Posted January 29, 2009 (edited) Write some line to the console or use MsgBox to inform that this code line reached because I've tried your script and it does close the OUTLOOK.EXE process. Thanks for the prompt reply however in Vista SP1 running Outlook 2003 and MapiLab [manages the Outlook security features] Outlook is not closed when this script completes... Edited January 30, 2009 by anixon
Authenticity Posted January 30, 2009 Posted January 30, 2009 Strange, you can close the process using ProcessClose (I know it's the ugliest way) and just delete the object reference, Vista introduced many unwanted effects heh.
anixon Posted January 30, 2009 Author Posted January 30, 2009 Strange, you can close the process using ProcessClose (I know it's the ugliest way) and just delete the object reference, Vista introduced many unwanted effects heh. I guess this code will close all occurances of outlook.exe Const $DefaultEmail = "outlook" CODE$PID = ProcessExists($DefaultEmail & ".exe") If $PID <> 0 Then $list = ProcessList($DefaultEmail & ".exe") For $i = 1 To $list[0][0] ProcessClose($DefaultEmail & ".exe") ProcessWaitClose($DefaultEmail & ".exe", 30) Next ExitLoop EndIf but how do you delete the object reference?
anixon Posted January 30, 2009 Author Posted January 30, 2009 I think that it's "$o_Outlook = 0"I think that you are probably right sounds familar.. its over 40c 'boy is it hot' today 'Melbourne AU' so I am now off to find a fridge with seating room and a TV.. Thanks for your help which was very much appreciated Ant..
bo8ster Posted January 30, 2009 Posted January 30, 2009 I think that you are probably right sounds familar.. its over 40c 'boy is it hot' today 'Melbourne AU' so I am now off to find a fridge with seating room and a TV.. Thanks for your help which was very much appreciated Ant..LOL I know the feeling - its 39 already here in Adelaide, been 44 or 45 all week! Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]
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