ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

°»´ú"1.xls"ÀɬO§_§e¥´¶}ª¬ºA?

«Øij¤@¶}©l´N±N¡A¸ô®|»PÀɦW³]©w¦¨¤£¦PÅܼơC¤è«K¤§«á§Q¥Î¡C
¥t¥~
'The following function returns the filename without the extension from the file's full path:
Function FileNameNoExt(strPath As String) As String
    Dim strTemp As String
    strTemp = Mid$(strPath, InStrRev(strPath, "\") + 1)
    FileNameNoExt = Left$(strTemp, InStrRev(strTemp, ".") - 1)
End Function

'The following function returns the filename with the extension from the file's full path:
Function FileNameWithExt(strPath As String) As String
    FileNameWithExt = Mid$(strPath, InStrRev(strPath, "\") + 1)
End Function

'¨ú±o¸ô®|
'the following function will get the path only (i.e. the folder) from the file's ful path:
Function FilePath(strPath As String) As String
    FilePath = Left$(strPath, InStrRev(strPath, "\"))
End Function

TOP

«Øij¤@¶}©l´N±N¡A¸ô®|»PÀɦW³]©w¦¨¤£¦PÅܼơC¤è«K¤§«á§Q¥Î¡C
¥t¥~
'¨ú±o¸ô®|»PÀɦW(¤£¥]¬A°ÆÀɦW)
'The following function returns the filename without the extension from the file's full path:
Function FileNameNoExt(strPath As String) As String
    Dim strTemp As String
    strTemp = Mid$(strPath, InStrRev(strPath, "\") + 1)
    FileNameNoExt = Left$(strTemp, InStrRev(strTemp, ".") - 1)
End Function

'¨ú±o§¹¾ãÀɦW
'The following function returns the filename with the extension from the file's full path:
Function FileNameWithExt(strPath As String) As String
    FileNameWithExt = Mid$(strPath, InStrRev(strPath, "\") + 1)
End Function

'¨ú±o¸ô®|
'the following function will get the path only (i.e. the folder) from the file's ful path:
Function FilePath(strPath As String) As String
    FilePath = Left$(strPath, InStrRev(strPath, "\"))
End Function

TOP

        ÀR«ä¦Û¦b : «Ý¤H°h¤@¨B¡A·R¤H¼e¤@¤o¡A´N·|¬¡±o«Ü§Ö¼Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD