What is the way to close outlook 2007 from a script?
Winclose("outlook") doesn't work
Nevermind..forgot the tilda
If WinExist("~Microsoft Outlook") Then WinClose("~Microsoft Outlook")
This is an excellent example of my favorite kind of topic on this forum . 8)
LOL ... that was good
Is there a better alternative way to close outlook and then re-open it?
I have started having issues with the above script in that outlook doesn't close and appears to be waiting for some input or no closing because it's in the middle of a send receive, etc.
Here I go again...I came across this code below and it works PERFECTLY as a .bat file, how would I get this into WBT, as I want to make it more secure in an .exe?
@echo off
For /F "Tokens=1" %%I In ('tasklist /FI "IMAGENAME eq OUTLOOK.EXE"') Do If /I "%%I"=="OUTLOOK.EXE" taskkill /f /im outlook.exe
Start Outlook.exe
Have you tried "TerminateApp". For example, on Windows 10 you can kill the "Mail" app with the following:
TerminateApp("HxOutlook", 3, 0)