在同一天,如已经复制过同样内则弹出对话框提示 vb编程 按Command1复制Text1+text2的输入内容时,在同一天,如已经复制过同样内则弹出对话框提示,“今天已经复制过该内容!”按“是”确认,按“否”取消。代码如何写? 补充说明:复制命令重复不提示,同一天复制的内容相同时才提示 Command1的任务是: Private Sub Command1_Click() Clipboard.Clear Clipboard.SetText Text1 + Text2.Text End Sub
If 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 If