by Brandon (46 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 15th May 2009
Date Added: Mon 8th February 2021
Rating: (1 Votes)
'function to open various Windows applications
On Error GoTo ErrHandler:
Select Case App
Case "Word"
strfile$ = "winword.exe"
Case "Access"
strfile$ = "msaccess.exe"
Case "Notepad"
strfile$ = "notepad.exe"
Case "Excel"
strfile$ = "excel.exe"
Case "PowerPoint"
strfile$ = "POWERPNT.exe"
End Select
OpenApplication = Shell(strfile$, vbNormalFocus)
ErrHandler:
MsgBox Err.Description
End Function