曹华群 :
在软件中导出的文件,要注意文件名非法字符,首先要把这些非法字符(9个非法字符)去掉。
非法文件名称字符:/ \ : * ? " < > |
'去掉文件名的非法字符
Private Function ConvertFileName(sFile As String) As String
'非法文件名称字符:/ \ : * ? " < > |
Dim s As String
s = sFile
If s <> "" Then
s = Replace(s, "/", "")
s = Replace(s, "\", "")
s = Replace(s, ":", "")
s = Replace(s, "*", "")
s = Replace(s, "?", "")
s = Replace(s, """", "")
s = Replace(s, "<", "")
s = Replace(s, ">", "")
s = Replace(s, "|", "")
ConvertFileName = s
End If
End Function
文档中心