This snippet describes how to read the registry in .NET to check if MS Word application is installed.
In our developement we often get to show any information in the Word document.
But before doing this we need to check whether the MS Word is being installed in the machine or not.
Here the below code shows how to check through VB.Net if any machine installed with MS word application or not.
First of all we have to import the namespace in the top of the page like this
Then go for the below code :-
Dim objKey As RegistryKey
Dim objSubKey As RegistryKey = Nothing
objKey = Registry.ClassesRoot
objSubKey = objKey.OpenSubKey("Word.Application")
If Not objSubKey Is Nothing Then
MessaBox.Show("MS Word is installed in this machine.")
MessaBox.Show("MS Word is not installed in this machine.")