473,382 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Creating more Winword processes

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.

Feb 1 '06 #1
1 1745
hello, i can't explain it but i maybe have a solution :

add this just after your code
w2.DisplayAlerts = False;

all errors should be hidden
;)

"Paguro Bernardo" wrote:
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.

Feb 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tony Roost | last post by:
I have created a test VB.Net form that will use MS Word to check the spelling of text in an input box The test application runs without a problem and I quit the word application at the end of the...
16
by: Asaf | last post by:
I am trying to create and use a COM object with C#.NET 2005. The assembly is set to "Register for COM interop" but when I am trying to call it from VB on Word 2003 I am getting this error: ...
3
by: James | last post by:
Howdy. I'm having difficulty getting winword.exe processes to die on our development server when using SET objWord = CreateObject("word.application") from an .ASP page. This problem exists on...
2
by: Dean Slindee | last post by:
Using this statement to utilize the spell checker in WinWord: WinOffice.clsWord.SpellChecker(txtNote.Text) 'this does not work because no main window is displayed 'Dim proc =...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.