Suppression of Graphic Paste When Text Is Also Present

General TRichView support forum. Please post your questions here
Post Reply
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

Suppression of Graphic Paste When Text Is Also Present

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Use PasteRTF, if CanPasteRTF returns True. But assign RTFReadProperties.IgnorePictures = True.
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

Post by DickBryant »

Perfect - exactly what I was looking for :-)
Post Reply