下面的代码意思是,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
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
你先把VB语法学一下吧。学程序不是打字,不理解照着敲的。