Tag Archives: clipboard

Paste Text from the Clipboard in Visual Basic 6.0

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
 

This will paste text from a textbox to the Windows clipboard using VB 6.0

 


Text1.SelText = Clipboard.GetText
 

 

ClipBoard Copy Text using Visual Basic 6.0

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
 

This is a simple little code snippet to copy text or a string to the windows clipboard.

        '
        'Need VB, 1 textbox
        Clipboard.SetText(Text1.SelText)

Cut Text to the Clipboard using Visual Basic 6.0

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
 

Shows how to use VB 6.0 and VB 5.0 to Cut text from the Textbox control to the Windows Clipboard.

'
'Need VB 5.0 or VB 6.0, 1 textbox control. Text1 is the name of your textbox control.

Clipboard.SetText(Text1.SelText)

Text1.SelText = ""

Clear the Windows Clipboard using VB 2005 and Higher

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
 

Uses the simple MY interface feature to clear the windows clipboard.

        '
        'Clear the Windows Clipboard.
        '
        My.Computer.Clipboard.Clear()

Copy and Paste Text with the Windows Clipboard in VB 2005 and Higher

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
 

This uses the MY interface to Copy Data To the Windows Clipboard and to Paste Data from the Windows Clipboard. Visual Basic 2005, Visual Basic.NET 2008, and Visual Basic 2010 is supported.

Copy Text

        Set(Copy) text to the Windows Clipboard.
        My.Computer.Clipboard.SetText("This is my text", TextDataFormat.Text)

Paste Text

        'Get(Paste) text from the Windows Clipboard.
        MsgBox(My.Computer.Clipboard.GetText(TextDataFormat.Text))