Click here to Skip to main content
15,121,678 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Below given MS support solution is creating new insatnce on the fly and getting the instance name:
http://support.microsoft.com/default.aspx?scid=kb;en-us;316126[^]
using Word = Microsoft.Office.Interop.Word;
	Word.Application wdapp;
	
	System.Diagnostics.Process.Start("<Path to WINWORD.EXE>");
	this.Activate();
	
	wdapp = (Word.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application");
	
	MessageBox.Show(wdapp.Name);	
	wdapp = null;

But I need no of word instances and its name, without creating new instance of word.

Could some one help me?
Posted
Comments
Sandeep Mewara 25-Apr-11 2:08am
   
I think read the same thing couple of days back... a repost?
2000 P 25-Apr-11 2:26am
   
hmmm.... Not ble to find solution, so thought post it as new question.
Sandeep Mewara 25-Apr-11 2:36am
   
So, did you got some reply there? you interacted with the answerer?

Editing the old one would also pop the question back to top of stack...

use this

object word;
 try 
{     
word = System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application"); 
} 
catch (COMException) 
{
     Type type = Type.GetTypeFromProgID("Word.Application");
     word = System.Activator.CreateInstance(type);
 } 
   
Comments
2000 P 28-Apr-11 7:22am
   
How to detect if different version of the word documents opened?
Rajesh Lagaria 28-Apr-11 20:00pm
   
microsoft office 2000,2003 file format *.doc and 2007 file format *.docx
HI
Please go through with this post
Running Instance of Word


Regards
Ankit
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900