Ciao pazienza,
hai ragione su l'utilizzo di FileName, però si ha l'effetto voluto solo se si toglie App.Path.
Infatti con .FileName = App.Path & "\Foto\*.*" la finestra della CD si apre sull'utima Dir selezionata - che non è la cosa voluta;
mentre togliendo App.Path e specificando l'intero percorso
.FileName = "D:\Test2\Foto\*.*" viene aperta sempre la stessa Dir, come segue:
Ciao e buon lavoro !codice:Private Sub Command1_Click() Dim FileName As String With CommonDialog1 ' Imposta CancelError su True: .CancelError = True On Error GoTo ErrHandler .DialogTitle = "Selezionare la destinazione del file" .Flags = cdlOFNHideReadOnly Or cdlOFNPathMustExist Or cdlOFNOverwritePrompt Or cdlOFNNoReadOnlyReturn .Filter = "File di programma (*.bmp)|*.bmp|Documenti di Testo (*.txt)|*.txt|" & _ "Tutti i Files (*.*)|*.*" .FilterIndex = 1 .DefaultExt = "bmp" .InitDir = "D:\Test2\Foto" '.FileName = App.Path & "\Foto\*.*" .FileName = "D:\Test2\Foto\*.*" .ShowOpen ErrHandler: ' é stato scelto Annulla: If Err.Number = 32755 Then Exit Sub End If End With End Sub

Rispondi quotando