Public Function GetFileTitle(Path As String, Optional Extension As Boolean = True) For i% = Len(Path) To 1 Step -1 If Mid$(Path, i%, 1) "" Or Mid$(Path, i%, 1) "/" Then Exit For Next i Select Case Extension Case True GetFileTitle = Mid(Path, i + 1, Len(Path) - i + 1) Case False GetFileTitle = Mid(Path, i + 1, Len(Path) - i - 4) End Select End Function
Public Function GetFileTitle(Path As String, Optional Extension As Boolean = True) For i% = Len(Path) To 1 Step -1 If Mid$(Path, i%, 1) "" Or Mid$(Path, i%, 1) "/" Then Exit For Next i Select Case Extension Case True GetFileTitle = Mid(Path, i% + 1, Len(Path) - i% + 1) Case False GetFileTitle = Mid(Path, i% + 1, Len(Path) - i% - 4) End Select End Function
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question