office word and c#

M

m.a

can I detect if word is installed at the user computer and if yes, which
version?

How can I write code to interact with a different version of word which is
not installed on my computer?

I can think of a solution such as (dummy code snippets)



object word =createobj("word.appliaction);

if (word != null) // word is installed

{

string version= word.GetVersion();

switch (version)

{

case "2000":

work_with_word_2000();

break;

case "2003":

word_with_word_2003();

break;

}

}



But how can I write this code in c#?



Any help is very appreciating.



Regards
 
J

jp2msft

I did something similar for Office Outlook.

First, you'll probably need to drop a reference into your project. My
particular case used:
Microsoft.Office.Core, and
Outlook
Yours (Office Word) would differ somewhat.

In your includes, you'll need something like:
using Outlook = Microsoft.Office.Interop.Outlook;

I apologize for not mapping it out exactly, but I don't know exactly. I just
know what I did to get access to the Outlook application.

Other options might be looking at the registry keys or in the User's
Applications folder (C:\Documents and Settings\User9\Application
Data\Microsoft\Office).

Hope this information does some good!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top