Tutorial :MFC - Check if Microsoft Word Program Exists


I was wondering if there is any way to figure out programatically if Microsoft Word (Word 2003) exists on the target PC. Creating this app on VS2005, C++.



You could create a new Word.Application COM object and read the Version property. Unfortunately that would take a few seconds until Word is loaded. (That is if it is installed)

If you cannot create the object, then Word is not installed. If it can be created and has a lower version number, only an old version is available.


Looping over the registry keys is an option e.g: all entries under HKEY_CURRENT_USER\Software\Microsoft\Office and see what the most recent version is. Depends on your performance and exact requirements.


The easiest way is probably to check the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office registry keys.

Under this tree there is a node for every version of Office, and under each version the installed projects have their own sub-key (Excel, Outlook, Word etc) that specifies the path it was installed to.

Note there may be multiple versions installed on a single PC. E.g. I have;


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »