Comment ouvrir un fichier à partir d'une application VB ?
Il faut employer l'API ShellExecute :
Private Const SW_SHOWNORMAL = 1
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA"
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal
lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As
Long
Private Sub Form_Load()
ShellExecute Me.hwnd, "open", "C:\Windows\File.txt",
vbNullString, "C:\Windows\", SW_SHOWNORMAL
End Sub |