Here is some code that will return the office component and its current path. This is also from http://www.vb-world.net/
VB Code:
  1. Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias _
  2.    "RegOpenKeyExA" (ByVal hKey As Long, _
  3.    ByVal lpSubKey As String, ByVal ulOptions As Long, _
  4.    ByVal samDesired As Long, phkResult As Long) _
  5.    As Long
  6.  
  7. Private Declare Function RegQueryValueEx Lib "advapi32.dll" _
  8.    Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal _
  9.    lpValueName As String, ByVal lpReserved As Long, _
  10.    lpType As Long, ByVal lpData As String, lpcbData As Long) _
  11.    As Long
  12.                                                                                                  
  13. Private Declare Function RegCloseKey Lib "advapi32.dll" _
  14.    (ByVal hKey As Long) As Long
  15.  
  16. Private Const REG_SZ As Long = 1
  17. Private Const KEY_ALL_ACCESS = &H3F
  18. Private Const HKEY_LOCAL_MACHINE = &H80000002
  19.  
  20.  
  21. '*****************************************************
  22. 'These functions return the path to the specified office
  23. 'application or a 0-length string if the application does not
  24. 'exist on the machine.  This is one good way to check whether a
  25. 'specific office application is present before trying to run
  26. 'automation code for that application
  27. '*****************************************************
  28. Public Function GetWordPath() As String
  29.     GetWordPath = GetOfficeAppPath("Word.Application")
  30.     'display path
  31.     MsgBox GetWordPath
  32. End Function
  33.  
  34. Public Function GetExcelPath() As String
  35.     GetExcelPath = GetOfficeAppPath("Excel.Application")
  36.     'display path
  37.     MsgBox GetExcelPath
  38. End Function
  39.  
  40. Public Function GetAccessPath() As String
  41.     GetAccessPath = GetOfficeAppPath("Access.Application")
  42.     'display path
  43.     MsgBox GetAccessPath
  44. End Function
  45.  
  46. Public Function GetOutlookPath() As String
  47.     GetOutlookPath = GetOfficeAppPath("Outlook.Application")
  48.      'display path
  49.     MsgBox GetOutlookPath
  50. End Function
  51.  
  52. Public Function GetPowerPointPath() As String
  53.     GetPowerPointPath =  GetOfficeAppPath("PowerPoint.Application")
  54.     'display path
  55.     MsgBox GetPowerPointPath
  56. End Function
  57.  
  58. Public Function GetFrontPagePath() As String
  59.     GetFrontPagePath = GetOfficeAppPath("FrontPage.Application")
  60.     'display path
  61.     MsgBox GetFrontPagePath
  62. End Function
  63.  
  64. Private Function GetOfficeAppPath(ByVal ProgID As String)  As String
  65.  
  66. Dim lKey As Long
  67. Dim lRet As Long
  68. Dim sClassID As String
  69. Dim sAns As String
  70. Dim lngBuffer As Long
  71. Dim lPos As Long
  72.  
  73.    'GetClassID
  74.    lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _
  75.           "Software\Classes\" & ProgID & "\CLSID", 0&, _
  76.            KEY_ALL_ACCESS, lKey)
  77.    If lRet = 0 Then
  78.  
  79.       lRet = RegQueryValueEx(lKey, "", 0&, REG_SZ, "", lngBuffer)
  80.       sClassID = Space(lngBuffer)
  81.       lRet = RegQueryValueEx(lKey, "", 0&, REG_SZ, sClassID, _
  82.           lngBuffer)
  83.  
  84.       'drop null-terminator
  85.       sClassID = Left(sClassID, lngBuffer - 1)
  86.       RegCloseKey lKey
  87.    End If
  88.    
  89.    
  90.    'Get AppPath
  91.     lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _
  92.         "Software\Classes\CLSID\" & sClassID & _
  93.         "\LocalServer32", 0&, KEY_ALL_ACCESS, lKey)
  94.  
  95.   If lRet = 0 Then
  96.       lRet = RegQueryValueEx(lKey, "", 0&, REG_SZ, "", lngBuffer)
  97.       sAns = Space(lngBuffer)
  98.       lRet = RegQueryValueEx(lKey, "", 0&, REG_SZ, sAns, _
  99.         lngBuffer)
  100.       sAns = Left(sAns, lngBuffer - 1)
  101.      
  102.       RegCloseKey lKey
  103.    End If    
  104.    
  105.     'Sometimes the registry will return a switch
  106.        'beginning with "/" e.g., "/automation"
  107.    
  108.     lPos = InStr(sAns, "/")
  109.         If lPos > 0 Then
  110.             sAns = Trim(Left(sAns, lPos - 1))
  111.         End If
  112.    
  113.     GetOfficeAppPath = sAns
  114.    
  115. End Function