View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Walter Briscoe Walter Briscoe is offline
external usenet poster
 
Posts: 279
Default Copy value of textbox to clipboard for use in another application

In message of Sun, 6
Oct 2013 05:57:57 in microsoft.public.excel.programming, Auric__
writes
isabelle wrote:

Le 2013-10-05 23:22, Connie a écrit :
On a userform I have created, I would like to add a command button to
copy the contents of a textbox on the form to the clipboard
so that the user can paste it to another application. I've searched the
forum, but I don't see an easy way to do this. Does anyone know if it's
possible? Thanks!


hi Connie,

Dim MyData As DataObject
Set MyData = New DataObject
MyData.SetText TextBox1.Text
MyData.PutInClipboard


For other options (including the Windows API, my personal preference) see
"How to: Send Information to the Clipboard" at MSDN:

http://msdn.microsoft.com/en-us/libr.../ff192913.aspx


Why is the Windows API your personal preference?
At first sight, it seems much more complicated.
Does it offer advantages I can't see?
--
Walter Briscoe