Execute a file with any extension .doc,.xls,.bmp as long the application is install in windows
Pass the file name and the function wil check from windows what is the application exe to run the file.Exp you want to run a abc.doc document from your program,u need to know msword.exe path and then you run the shell(applicate exe abc.doc,1) to execute the abc.doc This work with any extension as long as it register to windows. etc .xls,.vbp,.doc
AI
KI-Zusammenfassung: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Quellcode
Public Function runapp(strname As String, appname As String) As Long
Dim strResult As String
Dim lngResult As Long
Dim i, s_msg
s_msg = MsgBox("Launch " & appname & " ?", vbYesNo, appname)
If s_msg = vbYes Then
strResult = String(255, 0)
lngResult = FindExecutable(strname, vbNullString, strResult)
strResult = Trim(Replace(strResult, "/dde", "", 1))
'run the file and not an .exe file
i = Shell(Trim(Replace(strResult, vbNullChar, "", 1)) & " " & strname, 1)
End If
End Function
Originalkommentare (3)
Wiederhergestellt von der Wayback Machine