dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: VB5,VB6
Expertise: Intermediate
Jul 16, 2001

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


IsOfficeAppPresent - Check whether an Office application is present

Enum mbOfficeAppConstants
    mbWord = 0
    mbAccess = 1
    mbExcel = 2
    mbPowerpoint = 3
    mbOutlook = 4
End Enum

' Check whether the specified Office application is present
' Note: require GetRegistryValue
'
' Example:
'    Dim sDescr As String
'    sDescr = "Word is installed: " & IsOfficeAppPresent(mbWord) & vbCrLf & '   
'      "Access is installed: " & IsOfficeAppPresent(mbAccess) & vbCrLf & '      
'   "Excel is installed: " & IsOfficeAppPresent(mbExcel) & vbCrLf & '        
' "Powerpoint is installed: " & IsOfficeAppPresent(mbPowerpoint) & vbCrLf & '   
'      "Outlook is installed: " & IsOfficeAppPresent(mbOutlook)
'    MsgBox sDescr

Function IsOfficeAppPresent(ByVal mbOfficeApp As mbOfficeAppConstants) As _
    Boolean
    Dim sApp As String
    Const HKEY_CLASSES_ROOT = &H80000000
    
    Select Case mbOfficeApp
        Case mbWord
            sApp = "Word.Document\CurVer"
        Case mbAccess
            sApp = "Access.Database\CurVer"
        Case mbExcel
            sApp = "Excel.Sheet\CurVer"
        Case mbPowerpoint
            sApp = "PowerPoint.Slide\CurVer"
        Case mbOutlook
            sApp = "Outlook.Envelope\CurVer"
    End Select
    'if it reads a value, the key exists --> the application is installed
    IsOfficeAppPresent = (Len(GetRegistryValue(HKEY_CLASSES_ROOT, sApp, _
        "")) > 0)
End Function
Marco Bellinaso
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date