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

get current Instance of Word

hi

i want to open a document in word by my app. therefore i wrote some code.

Type tWordApp = Type.GetTypeFromProgID("Word.Application");
Word.ApplicationClass oWordApp = (Word.ApplicationClass)
Activator.CreateInstance(tWordApp);

the probem is that i get a complete new instance even when the user already
opend the word before starting my application. so i'm looking for a solution
to check fist if there are currently any instances of the word application.
does anybody know how to do that?
thank you! jazper m.

Nov 16 '05 #1
3 4087
APG
Did you try Activator.GetObject() method ?

HTH.
Jazper Manto wrote:
hi

i want to open a document in word by my app. therefore i wrote some code.

Type tWordApp = Type.GetTypeFromProgID("Word.Application");
Word.ApplicationClass oWordApp = (Word.ApplicationClass)
Activator.CreateInstance(tWordApp);

the probem is that i get a complete new instance even when the user already
opend the word before starting my application. so i'm looking for a solution
to check fist if there are currently any instances of the word application.
does anybody know how to do that?
thank you! jazper m.

Nov 16 '05 #2
> Marshal.GetActiveObject()
great. i'll try it.
jazper
Nov 16 '05 #3
> Did you try Activator.GetObject() method ?
no. because i did not find a method like that by intelisense...
however i'll try it too...
jazper
Nov 16 '05 #4

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

Similar topics

5
by: Robert Ferrell | last post by:
I have a question about assigning __call__ to an instance to make that instance callable. I know there has been quite a bit of discussion about this, and I've read all I can find, but I'm still...
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: DaveS | last post by:
Hi! I need help opening a Word document from within an Access 2000/XP mdb. I'm using Shell to open the document, but the Access code continues to run past the Shell statement. What I need is...
9
by: Neil Ginsberg | last post by:
I have a strange situation using Access to automate a Word mail merge. Using Access 2000 and Word 2000, the code opens Word, opens the document in Word, sets a table in the calling Access...
3
by: tsteinke | last post by:
What is the syntax to refer to your current row in an SQL statement? I am using the "Lookup Wizard" to build a query in a table. How do you refer to the Current Row For instance I have a Table...
1
by: moelleni | last post by:
Hi, I made an Access 2002 Database and wanted to automate it to sent the current record to Word 2002. So readed the article "How to send the current record to Word 2000 with automation" I tried...
6
by: gizmo | last post by:
I have a requirement to initiate more than one instance of an application using the filenames. (the example below will start two instances of MS Word). My problem is that I need to kill each...
1
by: Simon | last post by:
Hi, I've used the wizzard in Visual Studio 2003 to create a Com Add-in for word. When word runs it opens a blank document. How can i refrence that document. I know how to open a new document and...
8
by: scorpion53061 | last post by:
My boss indicated he was pleased with the reports that were being generated in MS Word by me and that made me happy. However he also told me he wants the wait eliminated for Word to start up. I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.