Private Declare Function GetFileTitle Lib "comdlg32.dll" Alias "GetFileTitleA" (ByVal lpszFile As String, ByVal lpszTitle As String, ByVal cbBuf As Integer) As Integer
Function Extraer(PAth) As String
Dim Buffer As String
Buffer = String(255, 0)
GetFileTitle PAth, Buffer, Len(Buffer)
Extraer = Left$(Buffer, InStr(1, Buffer, Chr$(0)) - 1)
End Function
Private Sub Command1_Click()
MsgBox Extraer("c:\carpeta\carpeta\carpeta\archivo.htm")
End Sub