aztcaLISS
Messages postés91Date d'inscriptionsamedi 3 mai 2003StatutMembreDernière intervention25 avril 2008
-
2 août 2006 à 21:05
jamil1976
Messages postés4Date d'inscriptionjeudi 31 août 2006StatutMembreDernière intervention30 juin 2008
-
30 juin 2008 à 09:17
Salut,
Je voudrais savoir comment faire ouvrir une boite de dialogue d'ouveture de fichier avec Access 2000.
Molenn
Messages postés797Date d'inscriptionmardi 7 juin 2005StatutMembreDernière intervention23 février 20117 2 août 2006 à 21:59
Une copie d'un bout de code que j'ai mis dans un autre post récemment. C'est dans PowerPoint, mais ça doit aussi fonctionner dans ACCESS (puisque lorsque je l'ai pondu pour PowerPoint, j'avais repris un truc que j'avais fait dans ACCES, ça devrait coller :p) :
Private Sub CommandButton1_Click()
Dim OuvrirFichier As FileDialog
Dim FichierSélectionné As Variant
Set OuvrirFichier = Application.FileDialog( _
Type:=msoFileDialogOpen)
With OuvrirFichier
.AllowMultiSelect = True
.Show
For Each FichierSélectionné In .SelectedItems
MsgBox "Chemin du fichier sélectionné : " & FichierSélectionné
Next
End With
sifflet_
Messages postés70Date d'inscriptionmardi 25 juillet 2006StatutMembreDernière intervention 2 mai 2007 3 août 2006 à 07:33
Moi, j'ai dû faire ça pour mon projet, mais il y a pas mal de cases à
cocher dans les références de Visual-Basic (tools->references...) .
Entre autres, il faut importer la bibliothèque "Comdlg32.ocx" dans
C:\WINNT\SYSTEM32 qui correspond au "Microsoft Common Dialog Control
6.0 (SP3)". Si t'arrives pas, je t'énumèe la liste de ce qui est coché
chez moi. A+
Sifflet
Vous n’avez pas trouvé la réponse que vous recherchez ?
jamil1976
Messages postés4Date d'inscriptionjeudi 31 août 2006StatutMembreDernière intervention30 juin 2008 8 oct. 2007 à 11:39
de Jamil BETTAIEB:
------------------------------
Private Sub CommandButton1_Click()
'Declare a variable as a FileDialog object.
Dim fd As FileDialog
'Create a FileDialog object as a File Picker dialog.
Set fd = Application.FileDialog(msoFileDialogFilePicker)
'Declare a variable to contain the path
Dim vrtSelectedItem As Variant
'Use a With...End With block to reference the FileDialog object.
With fd
'Add a filter that includes GIF and JPEG images and make it the first item in the list.
.Filters.Add "Images", "*.gif; *.jpg; *.jpeg", 1
'If the user presses the action button...
If .Show = -1 Then
'Step through each string in the FileDialogSelectedItems collection.
For Each vrtSelectedItem In .SelectedItems
'vrtSelectedItem is a String that contains the path of each selected item.
'You can use any file I/O functions that you want to work with this path.
'This example simply displays the path in a message box.
MsgBox "Selected item's path: " & vrtSelectedItem
Next vrtSelectedItem
'If the user presses Cancel...
Else
End If
End With
'Set the object variable to Nothing.
Set fd = Nothing