| Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free! |
Visit clipboard in vbs
|
Original Message
|
Name: est
Date: November 25, 2005 at 03:29:27 Pacific
Subject: Visit clipboard in vbsOS: Windows XPCPU/Ram: PIII 1GHz |
Comment: how can I visit clipboard contents in a vbs file? Add me to your MSN! electronicstar@sina.com
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: dtech10
Date: November 25, 2005 at 13:58:35 Pacific
|
Reply: (edit)Hi This might help Cell A1 must contain data. Call TestClipboard to see effect. Range("a1").value is put in the Clipboard then it's value is put in "A5" and finnally the clipboard is cleared. Option Explicit Sub TestClipboard() Call PutOnClipboard(Range("a1")) Range("a5").Value = GetOffClipboard Call ClearClipboard End Sub Public Sub PutOnClipboard(Obj As Variant) Dim MyDataObj As New DataObject MyDataObj.SetText Format(Obj) MyDataObj.PutInClipboard End Sub Public Function GetOffClipboard() As Variant Dim MyDataObj As New DataObject MyDataObj.GetFromClipboard GetOffClipboard = MyDataObj.GetText() End Function Public Sub ClearClipboard() Dim MyDataObj As New DataObject MyDataObj.SetText "" MyDataObj.PutInClipboard End Sub
Report Offensive Follow Up For Removal
|

Post Locked
This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
Go to Programming Forum Home