how to put a variable value in clipboard with VBScript

4968 views
Skip to first unread message

Nemroth

unread,
May 20, 2007, 4:17:55 PM5/20/07
to
Hi,

Any One can say to me how to put a variable value in clipboard with
VBScript (used in a vbs file, not in a browser script) ?

If any, how to do it, please ?

Thanks by advance for your answer.

OfficeGuyGoesWild

unread,
May 20, 2007, 7:41:27 PM5/20/07
to

IIJIMA Hiromitsu

unread,
May 20, 2007, 9:32:21 PM5/20/07
to
Hi Nemroth,

> Any One can say to me how to put a variable value in clipboard with
> VBScript (used in a vbs file, not in a browser script) ?

You can exploit "InternetExplorer.Application" object.
See the complete sample code (though written in JScript) here:
http://frog.raindrop.jp/knowledge/archives/000824.html

Ayush

unread,
May 20, 2007, 10:19:04 PM5/20/07
to
[Nemroth]s message :
> Hi,

> Any One can say to me how to put a variable value in clipboard with
> VBScript (used in a vbs file, not in a browser script) ?

> If any, how to do it, please ?

You have to use a browser script to do this. Example:

Sub CopyText(text)
Set ie=CreateObject("InternetExplorer.Application")
ie.navigate "about:blank"
Do Until ie.ReadyState=4:Wscript.Sleep 100:Loop
ie.document.parentWindow.clipboardData.setData("Text",text)
ie.quit
Set ie=Nothing
End Sub

End Sub

Good Luck, Ayush.
--
Scripting Home : http://snipurl.com/Scripting_Home

Nemroth

unread,
May 21, 2007, 12:59:11 AM5/21/07
to
Thanks to all of you.
That what I needed.


Ayush a écrit :

Fosco

unread,
May 21, 2007, 1:49:46 AM5/21/07
to
Nemroth:

> Thanks to all of you.
> That what I needed.

; or autoit 2 line code

ClipPut("value")
MsgBox(262144, "", ClipGet( ))


; http://www.autoitscript.com/autoit3/files/beta/autoit/

--
Fosco

\RemS

unread,
May 21, 2007, 6:55:00 AM5/21/07
to
"Nemroth" wrote:


topic: "VBS to Copy Field Value to Clipboard"
http://www.tek-tips.com/viewthread.cfm?qid=1173511&page=1


Nemroth

unread,
May 21, 2007, 3:25:02 PM5/21/07
to
Thanks for the info. Very interessing

RemS a écrit :

Nemroth

unread,
May 21, 2007, 3:25:40 PM5/21/07
to
Thanks for the info.

Fosco a écrit :

tlst...@gmail.com

unread,
Sep 19, 2019, 1:26:46 PM9/19/19
to
An easy way to get stuff to the clipboard is to display the variable text as the default text displayed with the inputbox
i.e. myGuid = Mid(TypeLib.Guid, 2, 36)
InputBox "GUID:","GUID Generator",myGuid.

Then use your mouse to swipe the information and copy it to the clipboard.

Evertjan.

unread,
Sep 19, 2019, 6:11:19 PM9/19/19
to
tlst...@gmail.com wrote on 19 Sep 2019 in
microsoft.public.scripting.vbscript:
The advanced thanks is 12+ years old!



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

JJ

unread,
Sep 20, 2019, 5:14:51 AM9/20/19
to
On Fri, 20 Sep 2019 00:11:16 +0200, Evertjan. wrote:
>
> The advanced thanks is 12+ years old!

How the heck did he find the old thread?
I can't even find it by searching for the post title or message ID, from GG.
Reply all
Reply to author
Forward
0 new messages