'引用Microsoft Scripting Runtime Dim obj As FileSystemObjectPrivate Sub Form_Load() Set obj = New FileSystemObject MsgBox obj.FileExists("C:\abc\TEMP\A.TXT") '如果文件存在,返回真,否则返回假 End Sub
TO gaoqi1983() 谢谢,我要的结果是“temp”。
如果只是截取字符串用instr()应该就可以了吧!dim temp as intergertemp=instr("",""...)如果temp>0,则要找的字符串就找到了。
Dim obj As FileSystemObjectPrivate Sub Form_Load()
Set obj = New FileSystemObject
MsgBox obj.FileExists("C:\abc\TEMP\A.TXT")
'如果文件存在,返回真,否则返回假
End Sub
谢谢,我要的结果是“temp”。