本帖最后由 czjt1234 于 2013-8-28 15:09 编辑
1 要求选择后先ctrl + C复制- Dim objFSO, objTextStream, Form, TextBox
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- Set objTextStream = objFSO.OpenTextFile("C:\log.txt", 2, True)
- Set Form = CreateObject("Forms.Form.1")
- Set TextBox = Form.Controls.Add("Forms.TextBox.1").Object
- TextBox.MultiLine = True
- If TextBox.CanPaste Then
- TextBox.Paste
- objTextStream.Write TextBox.Text
- objTextStream.Close()
- End If
复制代码 2- Dim objFSO, objTextStream, objWshShell, strS, i
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- Set objTextStream = objFSO.OpenTextFile("C:\log.txt", 1, False)
- strS = objTextStream.ReadLine()
- Set objWshShell = CreateObject("Wscript.Shell")
- For i = 1 To Len(strS)
- objWshShell.SendKeys Mid(strS, i, 1)
- Next
复制代码
|