BP
Bhuvaneswari P
Syncfusion Team
February 2, 2009 07:23 AM UTC
Hi Martin,
Thank you for your interest in Syncfusion products.
DocIO doesn't have any API to work with clipboard. But we can work around this by using .Net library by converting the Clipboard object to image object and then insert the image into the word document. Please find the below code snippet to do so:
[C#]
WordDocument doc = new WordDocument();
doc.EnsureMinimal();
//Metafile
if (Clipboard.GetDataObject().GetDataPresent(typeof(Metafile)))
image = (Image)Clipboard.GetDataObject().GetData(typeof(Metafile));
//Bitmap
else if (Clipboard.GetDataObject().GetDataPresent(typeof(Bitmap)))
image = (Image)Clipboard.GetDataObject().GetData(typeof(Bitmap));
doc.LastParagraph.AppendPicture(image);
doc.Save("sample.doc");
Process.Start("Sample.doc");
Please try this and let us know if this helps you.
Best Regards,
Bhuvana