Hi everyone!
I want to add the full root of a folder to a textbox field but I am not sure what change to my code. Normally I use this code for select a file and it adds to my textbox the root of that file.... in this case I just want the root of the folfer where it is located example... (C:\Users\me\Desktop\Foldername\)
This is the code normallly I use for files....
'********************************************
Function EscogeFicheroRuta(Tipo As Integer) As String
Dim wzhwndOwner As Long
Dim wzAppName As String
Dim wzDlgTitle As String
Dim wzOpenTitle As String
Dim wzFile As String
Dim wzInitialDir As String
Dim wzFilter As String
Dim wzFilterIndex As Long
Dim wzView As Long
Dim wzflags As Long
Dim wzfOpen As Boolean
Dim Ret As Long
On Error GoTo EscogeFicheroRuta_Err
WizHook.Key = 51488399
wzhwndOwner = 0&
wzAppName = ""
If Tipo = 1 Then
wzDlgTitle = "Escoge fichero para guardar"
Else
wzDlgTitle = "Escoja fichero gráfico (Jpj,Gif etc) como fondo del Email"
End If
wzOpenTitle = "Escoja fichero"
wzFile = String(255, Chr(0))
wzInitialDir = CurrentProject.Path & ""
If Tipo = 1 Then
wzFilter = "Seleccionar Carpeta " _
& "(*.*)"
Else
wzFilter = "Fichero Gráfico " _
& "(*.jpg;*.gif;*.bmp)"
End If
wzFilterIndex = 1
wzView = 1
wzflags = 64
wzfOpen = True
Ret = WizHook.GetFileName(wzhwndOwner, _
wzAppName, wzDlgTitle, wzOpenTitle, wzFile, _
wzInitialDir, wzFilter, wzFilterIndex, _
wzView, wzflags, wzfOpen)
If Ret <> -302 Then
EscogeFicheroRuta = wzFile
Else
EscogeFicheroRuta = ""
End If
EscogeFicheroRuta_Exit:
Exit Function
EscogeFicheroRuta_Err:
MsgBox "Error nº " & Err.Number & vbCrLf & Err.Description & vbCrLf & _
"en procedimiento EscogeFicheroRuta de Módulo EscogeFicheroRuta", vbCritical, "Aviso de error"
Resume EscogeFicheroRuta_Exit
End Function
'****************************************
Thanks in advance for the help!