Results 1 to 4 of 4
  1. #1
    Join Date
    May 2015
    Posts
    3

    Unanswered: VBA Code to highlight a field and then activate Cotrol T

    I have a ring central phone and when i highlight a phone number i can press control-T and the number will be dialed - how do i put that into vba code for a button. I have the highlighting down.

    Me.txt_co_dbtor_mobile.SetFocus
    Me.txt_co_dbtor_mobile.SelStart = 0
    Me.txt_co_dbtor_mobile.SelLength = Len(Me.txt_co_dbtor_mobile) + 4

    Thank you for all your help.

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    495
    Provided Answers: 24
    in the button on click event

    put your code above in it.

  3. #3
    Join Date
    May 2015
    Posts
    3
    Quote Originally Posted by ranman256 View Post
    in the button on click event

    put your code above in it.
    Thank you but i have that part already - what i need to know is how to activate or run "Control-T" once the number is highlighted. in the button i can highlight the number but then physically have to press control-t - i would like that built in to the code.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    how are you "highlighting" the phone number?

    ...do you mean selecting it


    .what you could do is in the control on got focus event, enable a button that does what you want. I do it through a button so that it only dialls on active intervention as opposed to just when the control gets the focus
    you can use the sendkeys macro to imitate keyboard events and thus the <ctrl> T to dial the number
    I'd rather be riding on the Tiger 800 or the Norton

Tags for this Thread

Posting Permissions

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