Recuperi il percorso del Desktop con la SHGetFolderPath e lo imposti alla InitDir della CommonDialog:
codice:Private Declare Function SHGetFolderPath Lib "shfolder.dll" Alias _ "SHGetFolderPathA" (ByVal hwndOwner As Long, ByVal nFolder As Long, _ ByVal hToken As Long, ByVal dwReserved As Long, _ ByVal lpszPath As String) As Long Private Sub Command1_Click() Const CSIDL_COMMON_DESKTOPDIRECTORY = &H10 Const S_OK = &H0 Dim Cartella As String Dim Risultato As Long Cartella = Space(260) Risultato = SHGetFolderPath(Me.hWnd, CSIDL_COMMON_DESKTOPDIRECTORY, 0&, 1&, Cartella) If (Risultato = S_OK) Then CD.InitDir = Cartella CD.Flags = &H4 CD.ShowSave End If End Sub

Rispondi quotando