Results 1 to 3 of 3

Thread: How do I code two Send key commands at once?

  1. #1

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245
    I want to have a command button do the following:

    Text1.SetFocus
    SendKeys ("^A")
    SendKeys ("^C")

    See I need it to highlight Text1.Text and then copy it to the clipboard all in one command button press.

    Your help will be greatly appreciated,
    Daniel Christie

  2. #2
    Guest
    You can do it without SendKeys.

    Code:
    Private Sub Command1_Click()
    Text1.SelLength = Len(Text1.Text)
    Text1.SetFocus
    Clipboard.SetText Text1.SelText
    End Sub
    
    'Or:
    
    Private Sub Command1_Click()
    Clipboard.SetText Text1.Text
    End Sub

  3. #3

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245

    Thanks

    Thankyou Matthew, much appreciated.

Posting Permissions

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



Click Here to Expand Forum to Full Width