Close / Reopen Outlook

Started by MW4, February 25, 2016, 04:51:54 PM

Previous topic - Next topic

MW4

What is the way to close outlook 2007 from a script?

Winclose("outlook") doesn't work

MW4

Nevermind..forgot the tilda

If WinExist("~Microsoft Outlook") Then WinClose("~Microsoft Outlook")

td

This is an excellent example of my favorite kind of topic on this forum .  8)
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

MW4


MW4

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.

MW4

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

td

Have you tried "TerminateApp".  For example, on Windows 10 you can kill the "Mail" app with the following:

Code (winbatch) Select
TerminateApp("HxOutlook", 3, 0)

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade