473,320 Members | 1,856 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,320 software developers and data experts.

Detecting if Word instance is still running

I'm writing a C# program that uses a
Microsoft.Office.Interop.Word.Application instance to open and manipulate
documents.

Occassionally I get an "RPC Server is Unavailable" error. It seems that the
app has lost its connection to the Word instance it has opened. What is a
good way to check to see if the Word.Application instance still exists when
working on it?

Right now I have a global variable that holds the Word.Application object so
I don't have to recreate it every time it is used. It is disposed when the
form is closed. Is this the proper way to use the COM object, or should I go
ahead and recreate it every time?
Nov 22 '05 #1
0 1224

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

Similar topics

0
by: Diggler | last post by:
I'm writing a C# program that uses a Microsoft.Office.Interop.Word.Application instance to open and manipulate documents. Occassionally I get an "RPC Server is Unavailable" error. It seems that...
4
by: Daniel | last post by:
Hello, i have a problem with the word automation from c#. First, i want to mention, that i don't have any dependencies from word in my c#-project, i want to use the system.reflection model to...
3
by: John Smith | last post by:
Hey folks, I've got a Windows C# application that generates a .doc file and then allows the user to preview it. I generate the file using the StreamWriter class and do a flush() and a close()...
4
by: scorpion53061 | last post by:
In some situations MS Word is started in another thread by the end user. I am trying to figure out how, if possible, to detect if the user has shut down MS Word so I can kill the thread and clean...
7
by: Dave | last post by:
Apologies for the newbie question. I have created a vb.net program for my company that is designed to work with Word Templates (about forty of them that we commonly use) that are selected by the...
14
by: Alan T | last post by:
These are the codes I created a document: _WordApp = new Interop.Word.Application(); _WordApp.Visible = false; _WordDoc = new Document(); _Missing = System.Reflection.Missing.Value;
1
by: Esther Lane | last post by:
Hello! First off, many many thanks to Albert who wrote the Mail Merge code for MS Access I am using. It has been working beautifully for a few years. However, my client just (without notice!)...
0
by: ENTBedford | last post by:
My app starts Word, opens a new document, gets data to fill in demographics, then hands the doc to the user to type the body text of a letter. User then returns to the app to get another set of...
1
by: nassersh | last post by:
I am using a bound control to embed word documents within an access form. I have created two buttons on the form One to embed aand display and one to close. I embed one doc and then save the doc...
44
by: Pilcrow | last post by:
Is there a way that a proram can detect whether it is operating in an ASCII or an EBCDIC environment?
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.