Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to reference the Clipboard

Status
Not open for further replies.

trids

Programmer
Feb 23, 2001
21
Hi folks

Does anyone know how to reference the Clipboard from a *.VBS script? I want to write a script that will achieve what the following VB code does ..

Shell ("Explorer.exe /n, /e, " & Clipboard.GetText)

I can do the Shell-equivalent, but I'm stuck at Clipboard:

Set MyObj = CreateObject("WScript.Shell")
MyObj.Run "Explorer.exe /n, /e, " & Clipboard.GetText

Any ideas???

 
Hey - I did it!!

.. I wrapped the Clipboard object in a DLL, exposing only the GetText, Clear, and SetText methods. Now the following script works :) heh heh heh :) ...

Set oShell = CreateObject("WScript.Shell")
Set oClip = CreateObject("ClipClass.Clipboard")
oShell.Run "Explorer.exe /n, /e, " & oCLip.GetText

I use it by making a shortcut to the script, to which I then assign a shortcut key. Then, while reading documentation that refers to some or other path, I can explore that path by selecting it and copying to clipboard - followed by the shortcut-key!!

Chuffed, me! :)))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top