URGENT! Accès fichier

Manolo - 26 nov. 2001 à 11:25
bigbosstheone Messages postés 3 Date d'inscription vendredi 11 avril 2003 Statut Membre Dernière intervention 14 août 2003 - 14 août 2003 à 14:33
J'ai dans mon appli une liste de fichiers et je connais leurs paths
Je voudrai pouvoir les ouvrir (je recherche l'équivalent code de Fichier --> Ouvrir --> path du fichier), comme dans Outlook lorsqu'on double click sur une pièce jointe
Pour les exe, j'y arrive (shell + path)
comment faire pour les autres (xls, doc, pdf..)???

Aidez moi!

3 réponses

remoi, j'ai trouvé :

Public 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

Public Sub Navigate(frm As Form, ByVal WebPageURL As String)
'Ouvre un fichier par son path
Dim hBrowse As Long
hBrowse = ShellExecute(frm.hwnd, "open", WebPageURL, "", "", SW_SHOW)
End Sub

call Navigate(ME, path du fichier)
0
Y a + simple. Avec shell("notepad file.txt")
shell("worpad fichier.doc") ....
A+

Ceoph
0
bigbosstheone Messages postés 3 Date d'inscription vendredi 11 avril 2003 Statut Membre Dernière intervention 14 août 2003
14 août 2003 à 14:33
Quand j'effectue la méthode : Public declare function ShellExecute Lib "shell32.dll" ........................

à la compilation j'ai :
"compile error
Constants, fixed-lenght strings, arrays, user-defined types and Declare statement not allowed as public members of object modules

"

Je ne pige pas ...

A qui cela est due

Merci d'avance
0
Rejoignez-nous