Insert portions of RTF text?

Is it possible to insert an RTF encoded block (not HTML) of text into a Word document?

RTF insertion is not supported yet. We are going to implement it in 2-3 months.
Best regards,

Hi Stefan,
It always puzzles me how people want to use “portions” of RTF documents. It would be great if you elaborate on this, maybe attach some of those portions so we can better understand what you want to accomplish. From my point of view there could be no RTF portions because RTF must always be a complete document, not a fragment. When you have a piece of RTF text it will be referring to fonts, styles, colors and list defintions defined in the header portion of the document, an RTF fragment cannot exist without the header. So you are really talking about inserting small, but complete RTF documents, right?


let me briefly explain why I need rtf block insertion in my application. I’m using the Windowsforms RTF-Control (actually a somehow modified version) hosted inside Internet Explorer using -Tags.

Users should be able to copy their text from other documents into this control without losing styles and formattings (tabulators, tables etc.). This text portions must be inserted at a specific position in the document.

An example of the output of the RTF control:

{\rtf1\ansi\ansicpg1252\deff0\deflang1031{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fnil\fcharset0 Arial;}} {\stylesheet{ Normal;}{\s1 heading 1;}} \viewkind4\uc1\pard\keepn\s1\sb240\sa60\lang2057\kerning32\b\f0\fs32 Testheader\par \pard\kerning0\b0\f1\fs24 This is a test paragraph with a \b bold\b0 word.\par \pard\lang1031\f2\fs20\par }

I hope I’ve been able to explain my motivations.


Thanks, it certainly explains things well and confirms what we’ve been expecting.
Aspose.Words 4.0 now has export of a complete document to RTF. If you need to export fragments of a document to RTF you would need to workaround, maybe by creating an empty Document object and importing the fragment that you want into it and then saving as RTF. Later, we will make it possible to export just a particular fragment to RTF straight away.
But of course you need import of RTF in Aspose.Words. This feature is under development right now. In 2-3 months importing RTF will be possibler. I’m sure inserting RTF fragments such as yours will also be possible.

We’ve released Aspose.Words 4.1 which supports RTF import.

Did you have a example how to to insert an RTF encoded block (not HTML) of text into a Word document?

Thanks for your inquiry. This question is already answered in the following thread:
Best regards.