2

After opening a Word document, using .NET interop, a dialog box is created that blocks programmatic editing of the opened file. The user cannot see the winword.exe process and so cannot close the dialog. Is there a way to close a dialog or to prevent them being opened on startup?

I believe it might be the dialog asking first time users to set their name and initials.

Note: I know that it would be nicer to avoid using the interops and am familiar with Aspose products.

Nick
  • 5,875
  • 1
  • 27
  • 38
sfg
  • 489
  • 4
  • 7
  • I don't have an answer, but I would try to find a way to do something similar to the Interaction.SendKeys VBA function. – Foole Mar 09 '10 at 02:46
  • ...and send an Escape key. I'm almost certain that will close all modal Word dialogs. – Foole Mar 09 '10 at 02:54
  • Did you find a solution for this? Do Fooles comments work for you? We're havind similar problems with corrupted documents giving a warning dialog. When we programmatically try to close Word, there's a new dialog telling the user to close the first dialog. – Peter Mar 15 '10 at 15:54
  • I went in a different direction and so did not attempt Foole's way. I do think though that Foole's comment sound like a possible way to get around this problem. – sfg Mar 15 '10 at 17:18

1 Answers1

3

See my answer here.

Basically, you need to disable all "alerts", such the dialog that you describe above. Instead of "MSProject", use "Word" of course.

Community
  • 1
  • 1
dotNetkow
  • 5,053
  • 4
  • 35
  • 50