How to programatically close Microsoft Word dialog boxes
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: How to programatically close Microsoft Word dialog boxes

  1. #1
    Join Date
    Sep 2012
    Posts
    2

    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?

  2. #2
    Join Date
    Apr 2010
    Posts
    131

    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!

  3. #3
    Join Date
    Sep 2012
    Posts
    2

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center