trichview.com

trichview.support




clipboard


Return to index


Author

Message

Baliga, Narasimha

Posted: 12/17/2004 18:55:49


Hi Sergey,


  I have overriden rvActionPasteExecute method in my application and added

this code. This is mainly to support "paste" of HTML content.


    cf := RegisterClipboardFormat('HTML Format');

    if not IsClipboardFormatAvailable(cf) then

      rvActionPaste.ExecuteTarget(RichViewEditContent)

    else

    begin

      if Clipboard.HasFormat(CF_TEXT) then

      begin

        FStatusUpdateSplashFrm := TStatusUpdateSplashFrm.Create(Self);

        FStatusUpdateSplashFrm.lblStatus.Caption := 'Downloading images from

the internet... Please wait till we Parse the HTML and get all the

content...';

        FStatusUpdateSplashFrm.Show;

        FStatusUpdateSplashFrm.Refresh;

        try

          RvHtmlImporter.LoadFromClipboard;

          NormalizeRichView(RichViewEditContent.RVData);

          ClearCache;

        finally

          RichViewEditContent.Format;

          FStatusUpdateSplashFrm.Free;

        end;

      end;

    end;


I notice that if I use existing rvActionPasteExecute and click on menu item

paste, and if I have a content with some pictures it does not do anything

and I have to use Paste Special feature. But here we don't have option to

paste HTML content.


So I did the above code, but I see one problem. If it is normal text it's

fine, if it is an HTML content and I need to download the imgaes from some

site that is also fine. Problem is if I have a RTF content (with embedded

images) it goes in the first part of the if condition and inside

TrvActionPaste.Create method it throws an exception.


I was wondering if any one knows how to know different formats from

Clipboard content being pasted? Any link or tutorial is appreciated


regards

Baliga







Powered by ABC Amber Outlook Express Converter