Tuesday, August 11, 2015

How to copy content to Clipboard

Using Mercury.Clipboard:

'Creates an instance of Mercury.Clipboard
set objCB=createobject("Mercury.Clipboard")
'Here i am clearing already existing content in clipboard
objCB.Clear()
'Copying some text into Clipboard
objCB.SetText("Hello Uday")
'Retrieving the content from Clipboard
print objCB.GetText

Using DotNetFactory:
'Creates an instance of DotNetFactory Computer Object
Set objDFComputer=DotNetFactory("Microsoft.VisualBasic.Devices.Computer","Microsoft.VisualBasic")
'Here i am clearing already existing content in clipboard
Set objCB=objDFComputer.ClipBoard
objCB.clear()
'Copying some text into Clipboard
objCB.SetText("Hello Uday")
'Retrieving the content from Clipboard
print objCB.GetText

No comments:

Post a Comment