Hi,
I have been trying to work this problem out for ages but can't seem to find an answer.
this is what i have so far
[vba]Private Sub CommandButton3_Click()
Dim objData As DataObject
Dim strClipBoard As String
Set objData = New DataObject
'Clear clipboard
objData.SetText ""
objData.PutInClipboard
'Put text from textBox into clipboard
strClipBoard = Me.TextBox1.Value
objData.SetText strClipBoard
objData.PutInClipboard
'Get text from clipboard into a string variable
objData.GetFromClipboard
strClipBoard = ""
strClipBoard = objData.GetText
'activate window
AppActivate ("Untitled - Notepad")
= objData.GetText
End Sub[/vba]
so when the button is clicked, textbox1 text is copied to the clip board, sets the focus to the notepad window and is then supposed to paste. what am i supposed to be having at the end? atm as you can see it is blank infront of '= objData.GetText'.
if i get rid of the appactivate and put textbox2.text infront of '= objData.GetText', then it pastes from the clipboard.
i want the contents from the clipboard to paste into the active window. any active window i say to be active.
thanks