I can't copy a picture to word!

  • Thread starter Thread starter Lloyd Dupont
  • Start date Start date
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);
}
 
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);
}
 
Back
Top