Putting clipboard content into a string variable

J

John

If I copy some text into the clipboard, how do I put this text into a
VBA string variable?
 
H

Helmut Weber

Hi John,
well, there is a dataobject and a function
getfromclipboard. And there is some more to it.
Just put the text of the selection into you variable.

MyVar = selection.range.text

Greetings from Bavaria, Germany

Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
J

John

Thanks Helmut, That's exactly what I want to do - no need to use the
Clipboard.

Helmut Weber said:
Hi John,
well, there is a dataobject and a function
getfromclipboard. And there is some more to it.
Just put the text of the selection into you variable.

MyVar = selection.range.text

Greetings from Bavaria, Germany

Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98

Keep your VBA code safe, sign the ClassicVB petition
www.classicvb.org
 

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