| 1 |
Attribute VB_Name = "Module_FileFunctions" |
| 2 |
Option Explicit |
| 3 |
' |
| 4 |
|
| 5 |
Public Function GetFilenameOfFullPath(ByVal FullPath As String) As String |
| 6 |
|
| 7 |
Dim LastSlashPos As Integer |
| 8 |
Dim SlashPos As Integer |
| 9 |
|
| 10 |
SlashPos = InStr(1, FullPath, "\") |
| 11 |
|
| 12 |
While SlashPos > 0 |
| 13 |
|
| 14 |
LastSlashPos = SlashPos |
| 15 |
SlashPos = InStr(SlashPos + 1, FullPath, "\") |
| 16 |
|
| 17 |
Wend |
| 18 |
|
| 19 |
GetFilenameOfFullPath = Right(FullPath, Len(FullPath) - LastSlashPos) |
| 20 |
|
| 21 |
End Function |
| 22 |
|
| 23 |
Public Function GetPathOfFullPath(ByVal FullPath As String) As String |
| 24 |
|
| 25 |
Dim LastSlashPos As Integer |
| 26 |
Dim SlashPos As Integer |
| 27 |
|
| 28 |
SlashPos = InStr(1, FullPath, "\") |
| 29 |
|
| 30 |
While SlashPos > 0 |
| 31 |
|
| 32 |
LastSlashPos = SlashPos |
| 33 |
SlashPos = InStr(SlashPos + 1, FullPath, "\") |
| 34 |
|
| 35 |
Wend |
| 36 |
|
| 37 |
GetPathOfFullPath = Left(FullPath, LastSlashPos) |
| 38 |
|
| 39 |
End Function |
| 40 |
|