Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Copy value of textbox to clipboard for use in another application

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Copy value of textbox to clipboard for use in another application

hi Connie,

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

isabelle

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!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default Copy value of textbox to clipboard for use in another application

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

--
Ooh, it pulses. With... what kind of magic? Fate?
  #4   Report Post  
Posted to microsoft.public.excel.programming
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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default Copy value of textbox to clipboard for use in another application

Walter Briscoe wrote:

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

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?


Largely because I do a lot of programming outside of Office, and in many
languages, there is no other way.

One place where I prefer a non-API method is "normal" VB (i.e. VB6), where
you simply do this:

Clipboard.SetText "text here"

But that doesn't work in VBA. Shrug.

--
Anybody who thinks a little 9,000-line program that's distributed
free and can be cloned by anyone is going to affect anything we do
at Microsoft has his head screwed on wrong.
-- Bill Gates


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Copy value of textbox to clipboard for use in another application

note:

to use the "DataObject" object, you must load the following library:
"Microsoft Forms 2.0 Object Library". this is the same library
when you insert a form (userform) in a projetVBA

isabelle

Le 2013-10-06 01:14, isabelle a écrit :
hi Connie,

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

isabelle

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!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy application path to clipboard Jeff Norville Excel Programming 2 March 9th 09 10:00 PM
How to paste clipboard into textbox sheet? [email protected] Excel Programming 4 February 1st 08 05:23 PM
Excel <- Application clipboard data transfer Andreas Koenig Excel Programming 0 July 31st 04 09:35 PM
Put Info from Clipboard to Textbox on form Tom Ogilvy Excel Programming 0 July 21st 04 05:16 PM
Put Info from Clipboard to Textbox on form keepITcool Excel Programming 0 July 21st 04 05:11 PM


All times are GMT +1. The time now is 10:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"