Filename_Clean

Returns cleaned file name of invalid characters.
Needs to be modified if used for full path and file name.

CodeFunctionName
What is this?

Public

Tested

Original Work
Function Filename_Clean(FileN)
    ' Cleans file name from characters that are not accepted
    ' like / ' "
    ' More to add later
    '
    Rett = FileN
    Rett = Replace(Rett, " <", "")
    Rett = Replace(Rett, " >", "")
    Rett = Replace(Rett, ":", "")
    Rett = Replace(Rett, """", "")
    Rett = Replace(Rett, "/", "")
    Rett = Replace(Rett, "\", "")
    Rett = Replace(Rett, "|", "")
    Rett = Replace(Rett, "?", "")
    Rett = Replace(Rett, "*", "")
    Rett = Replace(Rett, "'", "")
    Rett = Replace(Rett, "    ", " ")
    Rett = Replace(Rett, "    ", " ")
    Rett = Replace(Rett, "    ", " ")
    Rett = Replace(Rett, " ", " ")
    Rett = Replace(Rett, "", "")
    Filename_Clean = Rett
End Function

FileN

Views 146

Downloads 74

CodeID
DB ID