copy text from textbox to another application

K

Ken

I have a worksheet with several textboxes and command buttons next to
them. The buttons have the following code:

Private Sub CommandButton1_Click()

Dim str As String

str = ActiveSheet.TextBox1.Text
Range("d1").Value = str
Range("d1").Copy

End Sub

The purpose of this is to copy the code from the textbox and paste
into a medical application called Road Notes. The code works fine for
copying and pasting with control V to another cell or a Word document;
but control V will not paste it into Road Notes. I would tend to
think that there was some Windows compatibility issue with Road Notes,
but, if I click on the textbox, then control A, then control C, then
switch to the applicable entry field in Road Notes, control V pastes
the text fine.

What is the difference between copying the text from a cell for
subsequent pasting and putting the text on the clipboard with control
C for subsequent pasting?

Thanks

Ken
 
M

Mike S

I have a worksheet with several textboxes and command buttons next to
them. The buttons have the following code:
Private Sub CommandButton1_Click()
Dim str As String
str = ActiveSheet.TextBox1.Text
Range("d1").Value = str
Range("d1").Copy
End Sub

The purpose of this is to copy the code from the textbox and paste
into a medical application called Road Notes. The code works fine for
copying and pasting with control V to another cell or a Word document;
but control V will not paste it into Road Notes. I would tend to
think that there was some Windows compatibility issue with Road Notes,
but, if I click on the textbox, then control A, then control C, then
switch to the applicable entry field in Road Notes, control V pastes
the text fine.

What is the difference between copying the text from a cell for
subsequent pasting and putting the text on the clipboard with control
C for subsequent pasting?

Thanks

Ken

Using The Clipboard In VBA

http://www.cpearson.com/excel/clipboard.htm
 
K

Ken

Thanks Mike. I have gotten a lot of great stuff from Chip's site
before. This is another.
Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top