file dialog Box qui s'ouvre dans un répertoire précis

E

Esperanza

Bonjour,
j'aimerais savoir si il est possible de donner un répertoire d'ouverture par
défaut pour le file dialog Box code.
Présentement il s'ouvre dans C:\mes documents.

Merci de votre aide !!
Esperanza


'===========================================================================
==
Private Sub cmdFileDialog_Click()
'Requires reference to Microsoft Office 10.0 Object Library.

Dim fDialog As Office.FileDialog
Dim varFile As Variant

'Clear listbox contents.

'Set up the File Dialog.
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
With fDialog

.AllowMultiSelect = False

'Set the title of the dialog box.
.Title = "Sélectionnez un fichier"

'Clear out the current filters, and add our own.
.Filters.Clear
.Filters.Add "All Files", "*.*"

'Show the dialog box. If the .Show method returns True, the
'user picked at least one file. If the .Show method returns
'False, the user clicked Cancel.
If .Show = True Then
'Loop through each file selected and add it to our list box.
For Each varFile In .SelectedItems
Me.txtAdresseFTP = varFile
Next
Else
MsgBox "Vous avez annuler."
End If
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top