Page 1 of 1

RTF to clipboard

Posted: Wed Dec 29, 2010 12:38 pm
by Tom
Hi, there.

I'm trying to copy a formatted RTF-text to the clipboard, so it can be pasted into a word processor "as is", with all formatting options. If I copy the formatted text using the standard method (oClipBoard:SetBuffer(cRtfText)), I receive a plain text with all formatting options ({\rtf ...). There must be a way to set the clipboard format to RTF, but I failed using RegisterFormat(). I even scanned all registered formats (using oClipBoard:GetFormatName()) and tried everything containing "RTF" or "Rich Text", but in this situation, just nothing was copied. This must be possible, but there's no constant inside XBP.CH for it. Any ideas?

Re: RTF to clipboard

Posted: Wed Dec 29, 2010 3:55 pm
by Auge_Ohr
hi,

as i wrote in German Xbase-Forum try XbpRTF()
use Property :SelRTF or :TextRTF and for "copy"

Code: Select all

METHOD MyRtf:Copy()
   SendMessageA( ::GetHWND(), WM_COPY, 0, 0 )
RETURN SELF