I can't copy a picture to word!

L

Lloyd Dupont

I have a copy code as below. Which works well inside my application.
But if I try to copy a picture into word, it always fail!
Any tips?

=====
public static void SetPasteboard(Object obj)
{
IDataObject ido = new DataObject();
ido.SetData(obj);

if (obj is Bitmap)
ido.SetData(DataFormats.Bitmap, obj);

Clipboard.SetDataObject(ido);
}
 
L

Lloyd Dupont

never mind...
the problem was that I also copyed empty RTF to the data object...
I have a copy code as below. Which works well inside my application.
But if I try to copy a picture into word, it always fail!
Any tips?

=====
public static void SetPasteboard(Object obj)
{
IDataObject ido = new DataObject();
ido.SetData(obj);

if (obj is Bitmap)
ido.SetData(DataFormats.Bitmap, obj);

Clipboard.SetDataObject(ido);
}
 

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