Copy text then Past Text into TextBox not working

  • Thread starter Thread starter RyanH
  • Start date Start date
R

RyanH

How can I copy text from another application (Microsoft Word) and then paste
it into a UserForm Textbox?

Thanks in Advance,
Ryan
 
Voila

Dim daoStr As DataObject
Dim strCB As String, strTemp As String
Set daoStr = New DataObject
daoStr.GetFromClipboard
strCB = daoStr.GetText
textbox1=strCB

HTH
 
Nigel,

Ctrl-V seems to work. Is there a way to right click then select Paste?

Jean-Yves,

Where do I place this code? Do I have to do this for every textbox?

Thanks
Ryan
 
Hi Ryan,


If this is for multiple textboxes, then better stick to keyboard comands.
The code I showed you should be used for one textbox only. I used a
comanddbutton
Or you have to trace which control has the focus.If Interested, google on
traceFocus.
 
Back
Top