Restart outlook from add-in project
-
Friday, February 22, 2013 12:39 PM
Hi
Is it possible to restart the outlook from a outlook add in project. My aim is In my addin project there is form called "settings". After user set the settings and click "ok button" on the settings form, need to close the form and restart the outlook.
Now I'm using this code
this._outlookRef.OutlookApp.Quit(); foreach (Process process in Process.GetProcessesByName("Outlook")) { process.Kill(); } Process.Start("OUTLOOK.EXE");
The problem is outlook is closing but not restarting. Is there any other way.
Thanks
Bobbin
- Edited by Bobbin Paulose Friday, February 22, 2013 12:47 PM
All Replies
-
Friday, February 22, 2013 1:04 PMMaybe try to take example from outlook itself - for example when you change cached mode on mailbox, it simply presents you with popup saying that changes will take effect after restarting outlook. Do not close outlook for user - he may have unsaved data in opened mails.
-
Friday, February 22, 2013 1:18 PM
Hi Damian
I didnt find any code to restart the outlook.
-
Friday, February 22, 2013 1:46 PM
yes, exactly my point - it is not up to you to decide when outlook should restart. Just inform user that he should restart outlook in order to see changes.- Proposed As Answer by Quist ZhangMicrosoft Contingent Staff, Moderator Monday, February 25, 2013 5:50 AM
- Marked As Answer by Quist ZhangMicrosoft Contingent Staff, Moderator Tuesday, March 05, 2013 10:54 AM
-
Friday, February 22, 2013 3:52 PMModerator
Not possible. An addin also can't disconnect or connect itself."Bobbin Paulose" <=?utf-8?B?Qm9iYmluIFBhdWxvc2U=?=> wrote in message news:410b9939-3abb-4a7d-831b-112e902e18ea...Hi
Is it possible to restart the outlook from a outlook add in project. My aim is In my addin project there is form called "settings". After user set the settings and click "ok button" on the settings form, need to close the form and restart the outlook.
Now I'm using this code
this._outlookRef.OutlookApp.Quit(); foreach (Process process in Process.GetProcessesByName("Outlook")) { process.Kill(); } Process.Start("OUTLOOK.EXE");
The problem is outlook is closing but not restarting. Is there any other way.
Thanks
Bobbin
Ken Slovak MVP - Outlook- Proposed As Answer by Quist ZhangMicrosoft Contingent Staff, Moderator Monday, February 25, 2013 5:50 AM
- Marked As Answer by Quist ZhangMicrosoft Contingent Staff, Moderator Tuesday, March 05, 2013 10:55 AM
-
Wednesday, February 27, 2013 10:13 AM
Hi,
Thanks for all replies.
I applied a bat file, to restart the outlook. I don't know its a good method, but its worked for me. I done like this, When user click on "ok button" I create a bat file and in that bat file I'm handling the closing and opening of Outlook. I'm using the below code in .bat file.
@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.exeThanks
Bobbin Paulose
- Marked As Answer by Quist ZhangMicrosoft Contingent Staff, Moderator Tuesday, March 05, 2013 10:55 AM

