Hi everybody,
I'm encountering some problem in trying to activate more than one
instance of Word from C#.
To keep it simple, I have a stupid Form, with just a button in it and
the following code:
private void button1_Click(object sender, System.EventArgs e)
{
Word.ApplicationClass w1 = new Word.ApplicationClass();
w1.Visible = true;
Word.ApplicationClass w2 = new Word.ApplicationClass();
w2.Visible = true;
}
When I click on the button I end up (as expected) with two winword
processes in the task manager, and two word windows on the screen.
But when I try to close the second Word, a MessageBox appears telling
me that Normal.dot is used by another user or application. When I press
OK a FilDialog appears asking me for a name to save the Normal.dot. I
press Cancel in this Dialog and nothing happens. If I try again to
close Word, another Dialog appears, stating that Normal.dot has been
modified and asking me if I want to save it. When I say No, Word
finally agrees to close.
Can you explain this strange (at least to me) behavior?
Thank you so much,
Francesco.