CISA FotoGallery

Statistiche

Tot. visite contenuti : 928204
Home Articoli tecnici Moduli Estrai FileName o PathName

Estrai FileName o PathName

Public Function GetPathPart(ByVal strPath As String) As String
'*****************************************************************
'Name : GetPathPart (Function)
'Purpose : Return Path name ONLY
'Author : Alessandro Baraldi
'E.Mail : Questo indirizzo e-mail è protetto dallo spam bot. Abilita Javascript per vederlo.
'Date : 23 gennaio 2002
'Called by :
'Calls :
'Inputs : strPath="C:\Programmi\DataBase.mdb"
'Output : GetPathPart="C:\Programmi\"
'*****************************************************************

Dim intCounter As Integer
For intCounter = Len(strPath) To 1 Step -1
If Mid$(strPath, intCounter, 1) = "\" Then
Exit For
End If
Next intCounter
GetPathPart = Left$(strPath, intCounter)
End Function



Public Function ParseFileName(ByVal FileName As String) As String
'*****************************************************************
'Name : ParseFileName (Function)
'Purpose : Return File Name ONLY
'Author : Alessandro Baraldi
'E.Mail : Questo indirizzo e-mail è protetto dallo spam bot. Abilita Javascript per vederlo.
'Date : 23 gennaio 2002
'Called by :
'Calls :
'Inputs : strFileName="C:\Programmi\DataBase.mdb"
'Output : ParseFileName="Database.mdb"
'*****************************************************************

On Error GoTo Err_ParseFileName
ParseFileName = Right(FileName, Len(FileName) - InStrRev(FileName, "\"))

'ParseFileName = Dir(FileName)
Exit_ParseFileName:
Exit Function

Err_ParseFileName:
MsgBox Err.Description
Resume Exit_ParseFileName
End Function