How to programatically close Microsoft Word dialog boxes
I'm using C# with .Net 4.0 in Visual Studio 2010 and the Process class to kick off Microsoft Word 2010 from the command with command line options. Occasionally Word dies and when restarted displays dialog boxes that need to be closed. I would like to automate closing the dialog boxes and am looking for ideas.
Can I use Microsoft.Office.Interop.Word or Microsoft.Office.Tools.Word to start Word with command line options and check and respond to dialog boxes?
Re: How to programatically close Microsoft Word dialog boxes
idk about responding to them, but you can generally avoid having them pop up in the first place when using interop with:
Code:
oWord = new Word.Application();
oWord.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone;
Good luck!
Re: How to programatically close Microsoft Word dialog boxes
Interesting. Not sure this will work for me. The dialogs appear because the winword app process was killed after a timeout period. It was running with certain add-ins that the subsequent run prompts the user to disable. I'm not sure that this approach will retain the add-ins.