Hello. I need to insert a program generated RTF formatted string into a RTF document opened by a WPRichText component. Basically I have one document that works as a template, and I need to insert in the middle of it some RTF formatted text. I used to do it successfully like that:
// loads the first RTF file into WPRichText
WPRichText1.LoadFromFile('Template.RTF', False, 'RTF');
// inserts the RTF formatted string at the end of WPRichText1 content
WPRichText1.SelLength := 0;
WPRichText1.CPPosition := maxint;
WPRichText1.FastInsertParagraph;
WPRichText1.SelectionAsString := rtf_formatted_string;
WPRichText1.ReformatAll(true,true);"
This works flawlessly when I save the final document as a RTF file, but when I save it as a DOCX file some fonts get replaced by Times New Roman.
Is there a better way of inserting a RTF string inside another RTF document?
Thanks