Home » » Detect the version of MS Office

Detect the version of MS Office

The easiest way to detect the version of MS Office that are installed on the computer, that is by reading the registry value. Here's the code:

Write the function code in the new module:
Function VersiOffice(ByVal Aplikasi As String) As String
    On Error GoTo Ero
    Dim Reg As Object
    Dim s As String
      
    Set Reg = CreateObject("Wscript.Shell")
    s = Reg.RegRead("HKCR\" & Aplikasi & ".Application\CurVer\")
    VersiOffice = Replace(s, Aplikasi & ".Application.", "", , , 1)
  
Ero:
End Function

Use code like this:
Dim v As String
v = VersiOffice("Word")
If v <> "" Then
    MsgBox ("Microsoft Word versi " & v)
Else
    MsgBox ("Microsoft Word tidak ter-install")
End If

Can be seen in the example above is used to detect the Word, then it can also be used to Excel, PowerPoint, Access, etc.
Jika Anda menyukai Artikel di blog ini, Silahkan klik disini untuk berlangganan gratis via email, dengan begitu Anda akan mendapat kiriman artikel setiap ada artikel yang terbit di Creating Website

0 comments:

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Sanjaya Catur Blogging - All Rights Reserved
Template Modify by Creating Website
Proudly powered by Blogger