Page 1 of 1

Suppression of Graphic Paste When Text Is Also Present

Posted: Sat Nov 22, 2008 1:26 am
by DickBryant
Hi Sergey,

I'm using the OnPaste event to prevent the user from pasting graphics directly into the TRichViewEdit. If I use PasteText, the text on the clipboard IS pasted without the graphic which is the result I want. The only problem is that the text loses any formatting it might have - say when copying text plus pictures from a MSWord document.

Is there any way to have the paste omit the graphic but include the formatting of the pasted text?

Posted: Sat Nov 22, 2008 11:03 am
by Sergey Tkachenko
Use PasteRTF, if CanPasteRTF returns True. But assign RTFReadProperties.IgnorePictures = True.

Posted: Sat Nov 22, 2008 12:36 pm
by DickBryant
Perfect - exactly what I was looking for :-)