还有没睡的嘛?或者起的比较早的
比如说我想判断"\abc\test.txt"是否存在应该用什么函数啊?谢谢

解决方案 »

  1.   

    Set FileSystemObject = CreateObject("Scripting.FileSystemObject")If Not FileSystemObject.FileExists(App.Path + "\text2.txt") Then
        Set TextStream = FileSystemObject.CreateTextFile("text2.txt")
    Else
        Set TextStream = FileSystemObject.OpenTextFile(App.Path + "\text2.txt")
    End If
    补充一下flc(菜鸟(API),请多多关照:)) 
    打开或创建文本文件时后面有三个参数ForAppending,ForReading,ForWriting
    ForAppending 在原来的基础上追加
    ForReading 只读
    ForWriting 清空原来内容,重写
      

  2.   

    if dir(app.path & "\abc\test.txt")<>"" then
          msgbox "已经存在!"
        else
          msgbox "不存在!"
    end if