Function to store the value into ClipBoard:
Public Function ClipBoardSetData(strData)
Dim objClipBoard 'As ClipBoard Object
'Create clipboard object
Set objClipBoard = DotNetFactory.CreateInstance("System.Windows.Forms.Clipboard","System.Windows.Forms")
objClipBoard.SetText(strData)
'Release the object
Set objClipBoard = Nothing
End Function
Function to Read the value from ClipBoard:
Public Function ClipBoardGetData() 'Return as String
Dim objClipBoard 'As ClipBoard Object
'Create Clipboard Object
Set objClipBoard = DotNetFactory.CreateInstance("System.Windows.Forms.Clipboard","System.Windows.Forms")
strData = objClipBoard.GetText
'Release the object
Set objClipBoard = Nothing
'Return the value
ClipBoardGetData = strData
End Function
No comments:
Post a Comment