函数代码:
复制代码 代码如下:
Sub CopyString(s)
Set forms=WScript.CreateObject("forms.form.1")
Set textbox=forms.Controls.Add("forms.textbox.1").Object
With textbox
.multiline=True
.text=s
.selstart=0
.sellength=Len(.text)
.copy
End With
End Sub
'调用
复制代码 代码如下:
CopyString "华域联盟 www.cnhackhy.com"
完整测试代码
复制代码 代码如下:
Sub CopyString(s)
Set forms=WScript.CreateObject("forms.form.1")
Set textbox=forms.Controls.Add("forms.textbox.1").Object
With textbox
.multiline=True
.text=s
.selstart=0
.sellength=Len(.text)
.copy
End With
End Sub
CopyString "华域联盟 www.cnhackhy.com"
msgbox "ok"
您可能感兴趣的文章:
本文由 华域联盟 原创撰写:华域联盟 » VBS实现将字符串写入剪切板的实现代码
转载请保留出处和原文链接:https://www.cnhackhy.com/16287.htm