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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clipboard access - best way? (64-bit gotcha)

Status
Not open for further replies.

jasonp45

Programmer
Aug 23, 2001
212
US
I can access the clipboard via the IE object, but this requires interaction.

Since I have AutoIt installed I found that I can write to the clipboard like this:
Code:
	Private Sub Write_to_Clipboard(sClipboard_Text)
	    Dim oAutoIt 'as Object = AutoItX3.Control
		Set oAutoIt = WScript.CreateObject("AutoItX3.Control")  
		oAutoIt.ClipPut sClipboard_Text
	    Set oAutoIt = Nothing
	End Sub

Here's the weird part. I'm running 64-Bit Win2008. If I put the above into a VBS and click on it, it works fine. If instead I call the script from a 32-bit launcher (SlickRun, which I use for everything) then I get an error message stating the AutoItX3 control can't be created. Same if I run the script using the 32-bit WScript.exe in the SysWOW64 folder.

I'm open to any alternative methods for reading/writing to the clipboard, or some kind of workaround with the AutoIt control.

Thanks.
 
Try using WSHExtra. This DLL was originally put out by Ziff Davis publishing (PC Magazine). A copy is available for download from my site:
I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top