如何获取粘贴板上的代码
如何获取粘贴板上的代码并把代码写入txt文件中,用vb实现,Sub 创建文本()
Dim fs, f, a, i, s As String
s = Clipboard.GetText
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("d:/123.txt", 8, True)
f.Writeline (123.txt = Clipboard.GetText())
f.Close
Set fs = Nothing
Set f = Nothing
End Sub
第6行代码有错f.Writeline (123.txt = Clipboard.GetText())
不知道应该怎样获得粘贴板上的代码并且写入新建的文本中,谢谢高手的指点
--------------------编程问答-------------------- f.Writeline (s)应该就好了呀。 --------------------编程问答-------------------- f.Writeline (Clipboard.GetText())
或者f.Writeline ("剪切板内容:" & Clipboard.GetText())
--------------------编程问答-------------------- 还是不可以啊,大神帮帮忙啊 --------------------编程问答-------------------- Private Sub Command1_Click()
Dim fs, f, a, i, s As String
s = Clipboard.GetText
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("d:/123.txt", 8, True)
f.Writeline (Clipboard.GetText())
f.Close
Set fs = Nothing
Set f = Nothing
End Sub
补充:VB , VBA