下面的代码意思是,vb编程 按Command1复制Text1+text2的输入内容时,在同一天,如已经复制过同样内则弹出对话框提示,“今天已经复制过该内容!”按“是”确认,按“否”取消。 补充说明:复制命令重复不提示,同一天复制的内容相同时才提示。运行时提示Do Untill EOF(1)语法错误,谁能改一下。是不是运行时没有加什么控件 或模块啊?
Private Sub Command1_Click()
Dim strTmp As StringIf Dir(App.Path & "\copied.txt") = "" Then
  Open App.Path & "\copied.txt" For Output As #1
  Print #1, Date
  Close #1
Else
  Open App.Path & "\copied.txt" For Input As #1
  Line Input #1, strTmp  If CDate(strTmp) <> Date Then
  Close #1
  Open App.Path & "\copied.txt" For Output As #1
  Print #1, Date
  Close #1
  Else
  Do Untill EOF(1)
  Line Input #1, strTmp
  If strTmp = Text1 & Text2 Then
  If MsgBox("今天已经复制过该内容!", vbOkCancel) = vbCancel Then
  Close #1
  Exit Sub
  End If
  Exit Do
  End If
  Loop
  Close #1
  End If
End IfClipboard.Clear
Clipboard.SetText Text1 & Text2.TextOpen App.Path & "\copied.txt" For Append As #1
Print #1, Text1 & Text2.T
Close #1
End Sub 

解决方案 »

  1.   

    先谢谢啦 又在Print #1, Text1 & Text2.T 提示语法错误
      

  2.   

    Print #1, Text1.Text & Text2.T.text
      

  3.   

    Print #1, Text1.Text & Text2.Text另外看了下,程序还有很多错误。
    你先把VB语法学一下吧。学程序不是打字,不理解照着敲的。
      

  4.   

    先谢谢啦 又在Print #1, Text1 & Text2.T 提示语法错误
      

  5.   

    Print #1, Text1.text & Text2.Text
      

  6.   

     Line Input #1, strTmp 在这里又有提示“错误 输入超出文件尾” 帮人帮到底吗?我来鸟,就帮我测试一遍好吗? 这段代码对我很有用的,我已经在论坛问了好多遍“一天内复制内容相同则提示'的问题,终于找到了答案,可就是在运行时老提示错误。 你帮帮忙吧,帮我运行遍,看看好友哪里错误好吗?