Write text to clipboard programmatically

E

elle0612

Hi

I wish to write a few lines of text to the clipboard using vba in Word.

For example the pseudo code would be something like,

this.text "hello my name is micky mouse" & vbCrLf & "My friend is minnie
mouse", send to clipboard.

Is this possible?

Thanks
 
G

Graham Mayor

Dim mText As DataObject
Set mText = New DataObject
mText.SetText "hello my name is micky mouse" & vbCr & "My friend is minnie
mouse"
mText.PutInClipboard


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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