hwoto:Windows Clipboard data in vb textbox

hello friends

here i have a problem that i want to get the contents of windows clipboard data into vb textbox.

in msword or some application i will select some text and that data will be taken back in vb textbox or string

is it possible please help

LVL 7
ydramuAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pratap_rCommented:
thats quite simple.

the Clipboard object will give you access to the clipboard you may access the text using

Clipboard.GetText()

that returns a string which you can use,

if you want to use RTF or HTML or any other format you can use Clipboard.GetData(<format>)

you can check if a particular format is there in the clipboard by using Clipboard.GetFormat(<format>)

i guess in your case Clipboard.GetText() should do.

Have Fun!
Pratap
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Shane Russell2nd Line Desktop SupportCommented:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconworkingwithgraphicformats.asp

http://www.google.com/search?hl=en&q=clipboard.gettext

here are a few URL's that should show you exactly what you want. How ever it is simmiliar to what the above comment shows, except for it has a few extra things like how to use activecontrol and other things.
0
ydramuAuthor Commented:
Sorry Pratap

I did the same already but it get the data of vb clipboard not the windows clipboard .

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

pratap_rCommented:
hmm there is no such thing as a seperate clipboard for vb alone.. the windows clipboard is exposed in vb through the ClipBoard object

Have Fun!
Pratap
0
ydramuAuthor Commented:
pratap
   in windows xp , in computer management in event manager there is a lot events i want to copy all event discriptions into a file by checking whether the source is of Error or not.

If it is Error then i will copy the description with SendKeys "^c"  by selecting the Event Properties with AppActivate "Event Properties". and then I will write the text to a file

but it is not working properly.
0
pratap_rCommented:
ydramu.. there are better ways to get the event log rather than relying on the clipboard. But the approach followed is quite different, i guess you should open a new question for that and close this one.

Have Fun!
Pratap
0
ydramuAuthor Commented:
ok pratap
i want to close the question
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.