Check if a Program is being installed or not?

16/12/2009 12:11
  1. Private bInstalled As Boolean
  2.  
  3. Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
  4.         Try
  5.             Dim oApp As Object = CreateObject("Outlook.Application")
  6.             bInstalled = True
  7.         Catch
  8.             bInstalled = False
  9.             MessageBox.Show("Office Application not installed!", "Office Installed", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  10.         End Try
  11. End Sub

Note: Specifying other Program not being installed or not. We wil just change the ff.

    e.g. - CreateObject("Programname.ApplicationType")

Back