Computing.Net > Forums > Programming > Visit clipboard in vbs

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

Reply to Message Icon

Original Message
Name: est
Date: November 25, 2005 at 03:29:27 Pacific
Subject: Visit clipboard in vbs
OS: Windows XP
CPU/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

Response Number 2
Name: est
Date: December 13, 2005 at 01:09:34 Pacific
Reply: (edit)

Really it does not work, can you explain it to me?

Add me to your MSN!
electronicstar@sina.com


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








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software