Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    copy to clipboard (2000 sr-1)

    Admit have a userform wit a button and textbox.
    When a call userform textbox i filled this textbox with a text similar "COPIA QUI!".
    Is possible to assign tothe button a command to copy to the clipbord the text in textbox for next use for pasting in other application?
    Hope you understand me.
    Tks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: copy to clipboard (2000 sr-1)

    Say you have a text box TextBox1 and a command button CommandButton1. The following On Click code will put the text from the text box on the Windows clipboard. If there is no text, you get a beep.

    Private Sub CommandButton1_Click()
    Dim objData As New DataObject
    If Not Me.TextBox1 = "" Then
    objData.SetText Me.TextBox1
    objData.PutInClipboard
    Else
    Beep
    End If
    Set objData = Nothing
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •