Closing Outlook Programmatically

  • Thread starter Thread starter Jerry Camel
  • Start date Start date
J

Jerry Camel

I've got a script that deletes the Outlook address cache file, but I need to
close Outlook before I can do this. The powers that be want the enitre
process automated, so I need to close Outlook from the script. Closing the
app is not a problem, but is there a way to supress the prompt for emtying
the trash? (Corp policy is to have Outlook prompt when closing and I can't
change corp policy... Nooo... wouldn't want to do that!) So I need a way
around it programmatically. Help?

Jerry
 
You might be able to use some of the window handle functions in the Win32
API (GetWindowHandle?) to pass the focus to the empty trash dialog. Then
you can try using SendKeys to click away the prompt. Might work, might
not - SendKeys can be tricky.
 
Back
Top