1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Private Function GetOfficeVersion() As String
Dim officeVersion As String = "Inconnue"
Try
Dim regKey As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Office\ClickToRun\Configuration")
If regKey IsNot Nothing Then
Dim platformValue As Object = regKey.GetValue("Platform")
If platformValue IsNot Nothing Then
Dim platform As String = platformValue.ToString()
If platform.Equals("x64", StringComparison.OrdinalIgnoreCase) Then
officeVersion = "Office 365 64 bits"
ElseIf platform.Equals("x86", StringComparison.OrdinalIgnoreCase) Then
officeVersion = "Office 365 32 bits"
End If
End If
regKey.Close()
End If
Catch ex As Exception
' Gérer les erreurs éventuelles
End Try
Return officeVersion
End Function |
Partager