Word clipboard with VB 2005

B

Bob

Using VB 2005 I have automated the selection of a Shape in Word 2003 and
copied to the clipboard.
How do I get the shape off the clipboard and into a Bitmap?

My code worked well in VS 2003 but when I converted to VS 2005 the Image
could no longer convert from the DataObject. Here is my 2003 code;

doc.Shapes("Picture 2").Select()
doc.Application.Selection.Copy()

Dim oDataObj As IDataObject = System.Windows.Forms.Clipboard.GetDataObject

Dim oImgObj As System.Drawing.Image = oDataObj.GetData(DataFormats.Bitmap,
True)

m_CardGraphic = New Bitmap(oImgObj)

I know the image is on the clipboard because I can manually paste it into
Word when a stop is made after the copy in code. But how to access it
programmaticallly has eluded me for days.

Thanks,
Bob
 

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