dim text as string
Private Sub baocun_Click() '保存按钮  text=""  Open App.Path & "\" & "1.txt" For Output As #1  Write #1, text
   
  Close #1   ' 关闭文件。End Sub我要实现的功能是保存一个什么都没有的空文本。。但是。。以上代码多出了2个".
要怎么解决呢?? 谢谢各位高手了。。

解决方案 »

  1.   

    你是不是想建立一个空的文本文件哦!引用mircrosoft scripting runtimeDim fso As New Scripting.FileSystemObject
    fso.CreateTextFile ("c:\2.txt")'这里可以根据你的需要设定路径和文件名称!
    Set fso = Nothing
      

  2.   

    Open App.Path & "\" & "1.txt" For Output As #1
      Close #1   ' 关闭文件。
      

  3.   

    我的意思是去掉那2个引号。。因为。。text这个变量我要赋值的。。比如。。
    text="123"
    输出结果为"123",我要求的输出结果为123。这个意思。。
      

  4.   

    open "c:\test.txt" for output as #1
    close#1