应该用文本框改变事件,而不是鼠标移动事件,另外不要用追加的方式写文本:
Private Sub Text1_Change()
FileNum = FreeFile
Open "d:\" & Date & ".txt" For OutPut As #FileNum
Print #FileNum, Text1.Text
Close #FileNum
End Sub
你上面的代码是没用你只需要:
Private Sub Text1_Change()
Open “c:\123.txt” For Output As #1
Print #1, Text1.Text
Close #1
End Sub