Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# .NET Word
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 24-Apr-11 21:00pm
2000 P569
Comments
Sandeep Mewara at 25-Apr-11 2:08am
   
I think read the same thing couple of days back... a repost?
prasad.koila at 25-Apr-11 2:26am
   
hmmm.... Not ble to find solution, so thought post it as new question.
Sandeep Mewara at 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...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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);
 } 
  Permalink  
Comments
prasad.koila at 28-Apr-11 7:22am
   
How to detect if different version of the word documents opened?
Rajesh Lagria at 28-Apr-11 20:00pm
   
microsoft office 2000,2003 file format *.doc and 2007 file format *.docx
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

HI
 
Please go through with this post
Running Instance of Word
 

Regards
Ankit
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,192
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 25 Apr 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100