Copy textbox contents to clipboard (1 Viewer)

jpl458

Well-known member
Local time
Today, 05:07
Joined
Mar 30, 2012
Messages
1,038
I have looked at several suggested solutions, none of which work, I think because windows has changed over the past few years. Seems like it should be simple enough, but I can't make it work. I've tried:

Code:
me.CallNo.setfocus
docmd.runcommand accmdcopy

No Dice.

Code:
With DoCmd
.GoToControl "Social"
.RunCommand acCmdCopy
End With

Tells me Copy isn't available now. Is there a reference that needs to be set?
 

moke123

AWF VIP
Local time
Today, 08:07
Joined
Jan 11, 2013
Messages
3,920
Have you tried selecting the text and then copying?
Code:
me.CallNo.SelStart = 0
me.CallNo.SelLength = len(me.CallNo)
 

jpl458

Well-known member
Local time
Today, 05:07
Joined
Mar 30, 2012
Messages
1,038
Have you tried selecting the text and then copying?
Code:
me.CallNo.SelStart = 0
me.CallNo.SelLength = len(me.CallNo)
It worked.

Code:
Private Sub CallNo_Click()
Me.CallNo.SelStart = 0
Me.CallNo.SelLength = Len(Me.CallNo)

With DoCmd
.GoToControl "CallNo"
.RunCommand acCmdCopy
End With

End Sub

This is not the solution I want. I need to be able to dial a phone number by dblclicking the textbox it's in. The problem is that I can't the bit of software that acts as a phone on a PC. It works with Google Voice, but we don't want to use that. Any ideas?
 

ebs17

Well-known member
Local time
Today, 14:07
Joined
Feb 7, 2020
Messages
1,946
Code:
Private Sub MyControl_DblClick(Cancel As Integer)
    ' with reference to MS Office XX.0 Object Library
    'Dim cb As New DataObject
    
    Dim cb As Object        ' Late Binding
    Set cb = CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
    With cb
        .SetText Me.MyControl
        .PutInClipboard
    End With
End Sub
 

moke123

AWF VIP
Local time
Today, 08:07
Joined
Jan 11, 2013
Messages
3,920
This is not the solution I want. I need to be able to dial a phone number by dblclicking the textbox it's in. The problem is that I can't the bit of software that acts as a phone on a PC. It works with Google Voice, but we don't want to use that. Any ideas?
I would think that it depends on the phone system/program you're using. Does the phone system have any API's to automate this sort of thing?
 

Users who are viewing this thread

Top Bottom