Friday, January 15, 2010

Copy Text to Clipboard in VB6

I thought it will be quite difficult to copy text to Clipboard in VB6, after I found this out. There is actually a built-in class called Clipboard which lets us easily copy and paste text.

Copy Text to Clipboard:

Private Sub CopyTextToClipboard(ByVal TextToCopy As String)
Clipboard.Clear
Clipboard.SetText TextToCopy
End Sub

Paste Text from Clipboard:
Private Function PasteTextFromClipboard() As String
PasteTextFromClipboard = Clipboard.GetText
End Function

It's just that easy! ^_^

No comments:

Post a Comment