views:

739

answers:

1

I have an asp.net/C# web application. I have an image steaming .aspx page to render images. I have to copy an image to client's clipboard. So I first load the image in a hidden image box and copy it to clipboard by using javascript command

ctrlRange.execCommand('Copy');

Image does copies to clipboard. It can be pasted in MSPaint. But it cannot paste in MS word. When try to paste it appear as small white box. Requirement is to paste image on MS word.

Thanks

+1  A: 

Issue seems to be with "Word paste" doing an additional web request, where as paint or Paste special doesn't do the second request. if the pasting content(image) is behind some sort of authentication (ex.forms authentication), the second request done by Word fails resulting in failing to paste the image properly.

This is related with, Internet Options -> General -> Browsing history ->Settings->Check for never versions of stored pages. When it's set to automatic, things work as expected even in Word and this fails with the setting "Every time I visit the web-page"

Thanks it worked. It seems IE settings get applied to MS word too. Reason for the white box at 'paste' was really an authentication problem and additional request at paste get failed. Setting IE browser temporary internet files setting to "Automatic" worked.
Dimuthu