Getting an Object From the Clipboard

  • Thread starter Montana DOJ Help Desk
  • Start date
M

Montana DOJ Help Desk

Word 2000

I have the following code for getting text off the clipboard (Variables
dim'd at the module level).

Private Sub ReadFromClipboard()
Set cbValue = New DataObject
cbValue.GetFromClipboard
cbData = Trim(cbValue.GetText)
Set cbValue = Nothing
End Sub

Now I need to do the same basic thing, but with an object instead of text.
The object is a picture that is copied to the clipboard manually, while
working in another application. I've experimented a bit with this, but
cannot get it to read an object off the clipboard. Does anyone know how
this can be done?


--

State of Montana
Department of Justice Help Desk

"Making the world a safer place."
 
J

Jonathan West

Hi Montana DOJ Help Desk

Go to http://vb.mvps.org/samples/. There is a sample ClipEx which you can
drop into your VBA project that recreated most of what can be done for the
clipboard in VB. Hopefully what you need to do is covered by that.
 

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