0 Replies Latest reply on Nov 9, 2012 3:09 AM by shah.bhavesh

    pastig from MS Word to  RichTextEditor   ?

    shah.bhavesh

      Hi

       

      i am trying to paste content from MS Word (office 2010) to rich text editor , with content i want to maintain the formatting and colour coding of text ?

       

      i tried below stuff but couldnt got the expected result/

       

      <s:RichEditableText paste="richeditabletext1_pasteHandler(event)" height="200" width="600" />

       

       

          

      protected function richeditabletext1_pasteHandler(event:Event):void

                                    {

                                              if(Clipboard.generalClipboard.hasFormat(ClipboardFormats.RICH_TEXT_FO RMAT)) {

                                                        var txt:RichEditableText = event.target as RichEditableText;                   

                                                        var html:String = Clipboard.generalClipboard.getData(ClipboardFormats.RICH_TEXT_FORMAT) as String;

                                                        var mgr:EditManager = txt.textFlow.interactionManager as EditManager;

                                                        mgr.pasteTextScrap(new TextScrap(TextConverter.importToFlow(html, TextConverter.TEXT_LAYOUT_FORMAT)));

                                                        event.stopImmediatePropagation();

                                              }

                                    }

       

      expecting help from community ?