Exact Duplicate:
C#: How to know whether certain Office 2003 or 2007 application is installed?
How to check if MSWord 2003 0r 2007 is installed in the system using C# code?
This code shows that a simple registry check will do the job.
Here is the code converted to C# (and slightly improved to use a using
statement).
using Microsoft.Win32;
// Check whether Microsoft Word is installed on this computer,
// by searching the HKEY_CLASSES_ROOT\Word.Application key.
using (var regWord = Registry.ClassesRoot.OpenSubKey("Word.Application"))
{
if (regWord == null)
{
Console.WriteLine("Microsoft Word is not installed");
}
else
{
Console.WriteLine("Microsoft Word is installed");
}
}
Note that it's not good enough to check C:\Program Files\Microsoft Office\
for the msword
EXE file, as the user might have installed it somewhere else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With