'---------------------------------------------------------------------------- ' ' This script obtains the running Outlook object (if any) and tells it to exit. ' '---------------------------------------------------------------------------- ' ' (c) 2004 12noon, Stefan K. S. Tucker. All rights reserved. ' ' You have a royalty-free right to use, modify, reproduce and distribute ' the Sample Application Files (and/or any modified version) in any way you ' find useful, provided that you agree that 12noon has no warranty, ' obligations or liability for any Sample Application Files. ' '---------------------------------------------------------------------------- option explicit dim app 'as Outlook.Application on error resume next set app = GetObject(, "Outlook.Application") ' returns the Outlook Application object on error goto 0 ' if this fails, the Outlook application is not running. if (not IsObject(app)) then call OutlookNotRunning elseif (app is nothing) then call OutlookNotRunning else app.Quit set app = Nothing end if sub OutlookNotRunning ' call MsgBox("Unable to find a running instance of Outlook.", vbOKOnly + vbExclamation, "12noon") wscript.Quit(3) end sub