|
Visual Basic (VB and VBA) |
|
Copyright 1999-2001 Christopher Greaves. All rights reserved. Home Page and email to [email protected] |
| If in doubt, record a macro and inspect the entrails! |
Please read the DISCLAIMER.
Here is an INDEX to all the procedures.
You will probably need one copy of my GLOBAL DECLARATIONS.
Public Function FindExecutable(s As String) As String
'Private Declare Function FindExecutableA Lib "shell32.dll" (ByVal lpFile As String, ByVal lpdirectory As String, ByVal lpResult As String) As Long
'Private Const MAX_FILENAME_LEN = 256
Dim i As Integer
Dim s2 As String
s2 = String(MAX_FILENAME_LEN, 32) & Chr$(0)
i = FindExecutableA(s & Chr$(0), vbNullString, s2)
If i > 32 Then
FindExecutable = Left$(s2, InStr(s2, Chr$(0)) - 1)
Else
FindExecutable = ""
End If
'Sub TESTstrFindExecutable()
'MsgBox FindExecutable("winword.exe")
'End Sub
End Function
| We all knew nothing when we started … |
|
Home Page and Contact Information Send email to [email protected]. This page was last updated Thursday, November 15, 2001 |