通过检查注册表判断
Public Function isOfficeInstalled() As Boolean
Dim oRegKey As Object
Dim strPath As String
On Error Resume Next
' 检查 Office 2016 的注册表项
strPath = "HKLM\Software\Microsoft\Office\ClickToRun\ProductReleaseIds"
Set oRegKey = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
If oRegKey.EnumKey(HKEY_LOCAL_MACHINE, strPath, SubKeys) =
Then
For Each subkey In SubKeys
If subkey = "Office16" Then
' Office 2016 已安装
isOfficeInstalled = True
Exit Function
End If
Next subkey
End If
' Office 2016 未安装
isOfficeInstalled = False
End Function