'提取文件的名称
Public Function FileName(file As String) As String
Dim i As Integer
Dim File_Str() As String
File_Str() = Split(file, "\")
i = UBound(File_Str)
FileName = File_Str(i)
End Function
Public Function FileName(file As String) As String
Dim i As Integer
Dim File_Str() As String
File_Str() = Split(file, "\")
i = UBound(File_Str)
FileName = File_Str(i)
End Function
Dim x As String
Dim position As Integer
Dim y As Integer
Dim myPath As String
'If InStr(1, filename, ".htm", vbTextCompare) = 0 Then GoTo ll x = filename
For y = Len(x) To 1 Step -1
If Mid(x, y, 1) = "/" Then
position = y - 1
Exit For
End If
Next ymyPath = Left(x, position)GetFilePath = Format(myPath)
Exit Function
LL:
GetFilePath = filename
End Function
Dim i As Integer
aa = "C:\Documents and Settings\Administrator\桌面\weboffice\1.wav"
i = InStr(1, aa, "\")
Do While i <> 0
aa = Right(aa, Len(aa) - i)
i = InStr(1, aa, "\")
Loop有點麻煩
end function没试过您自己试试吧!!!!!!