VBS实现将字符串写入剪切板的实现代码
程序员文章站
2022-07-04 20:32:42
函数代码: 复制代码 代码如下: sub copystring(s) set forms=wscript.createobject("forms.form.1") set...
函数代码:
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.jb51.net"
完整测试代码
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.jb51.net"
msgbox "ok"
复制代码 代码如下:
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.jb51.net"
完整测试代码
复制代码 代码如下:
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.jb51.net"
msgbox "ok"
上一篇: VBS版百度贴吧代码格式化调整工具
下一篇: vbs列出内网的中计算机(工作组也可以)