"Russ" <ru...@acordiamn.com> wrote in message
news:eBEzTtMF...@TK2MSFTNGP12.phx.gbl...
If you can install a third-party ActiveX, check out AutoItX, freeware
by Hiddensoft. It is a good overall addition, has some significant
improvements over straight VBS and has more articulate and reliable
window management, sendkey data, universal shutdowns, and simple
clipboard methods and functions.
http://www.hiddensoft.com/AutoIt/
If you want straight VBS ...
Here is a Tom Lavedas - Walter Zachary workaround to read the
clipboard content with the HTMLFile object:
Set oHtml = CreateObject("htmlfile")
sClipText = oHtml.ParentWindow.ClipboardData.GetData("text")
WScript.Echo sClipText
However, 'htmlfile' only works for reading the clipboard.
For writing to the clipboard, the standard trick is to
write to notepad or a text box and transfer. See ...
http://www.borncity.com/WSHBazaar/News7.htm
There's also a script posted there on using the HTML
ExecCommand method for trnsfer.
For writing, you can also use InternetExplorer.Application
(this is untested air code, so test for errors; it's based on
jscript code posted by Christoph):
Set oIE= CreateObject("InternetExplorer.Application")
With oIE
Do: .Navigate "about:clipdata": Loop While .busy
Set oData= .Document.ParentWindow.ClipboardData
End With
oData.SetData("Text", "your text string")
sText= oData.getData("Text")
oIE.Quit
WScript.Echo sText
Per Torgeir Bakken, these methods can result in error messages.
To them, change the IE settings:
Tools \ Internet Options \ Security tab \ Internet \
"Drag and drop or copy and paste files"
from "Prompt" to "Enable" .
or add about:blank and about:clipdata to the "Trusted sites"
security zone if trusted sites are allowed to copy and paste.
Joe Earnest