They say you learn something new every day.

This is quite a nifty little bit of VBScript for adding something to the user’s clipboard.

strCopy = “This text has been copied to the clipboard.”

Set objIE = CreateObject(“InternetExplorer.Application”)
objIE.document.parentwindow.clipboardData.SetData “text”, strCopy

Have to admit, I’m beginning to go off VB Script. Obviously, it’s incredibly useful, since it works on every Windows machine, and lets you do things like make HTAs, scripts etc.

But, it’s less useful when you move onto the web, because you have to use javascript if you want any hope of it working on people’s computer. But then, with javascript, you can’t access local resources (so you can’t connect to databases) or do things like this cool clipboard copy trick.

Basically, there are some cool things that VBS can do. And you can do them in HTAs or scripts, but as soon as you go online, you need to either have a downloadable HTA, or use a mixture of javascript and a server side language.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Tag Cloud

%d bloggers like this: