If you have a stylesheet in CSS format you can load it with
WPRichText1.LoadFromFile( 'test.htm', true, 'AUTO-csspath:"style.css"')
This is test,html
<html>
<head>
<link rel=stylesheet href="any_name.css">
</head>
<body>
<div class="Normal">Normal Line</div>
<div class="Text">Text Line</div>
<div class="Text">Text Line</div>
<div class="Text">Text Line</div>
</body></html>
This is style.css
.Normal{text-indent:0.00in;line-height:115%;text-align:left;vertical-align:top;font-family:'Calibri';font-size:11.00pt;margin:0.00in 0.00in 0.14in 0.00in;}
.Text{text-indent:0.00in;text-align:left;vertical-align:top;font-size:12.00pt;margin:0.00in;}
div{font-family:'Arial';font-size:11.00pt;}
If the file any_name.css actually exists, it is loaded instead of style.css, unless you modify the behavior using the event OnRequestHTTPString
procedure TForm1.WPRichText1RequestHTTPString(
RTFData: TWPRTFDataCollectionBase; Reader: TWPCustomTextReader;
const LoadPath, url: string; var LoadedString: AnsiString; var Ok: Boolean);
If you want to load a style sheet to your HTML data you do not need the csspath option. Simply load the CSS into your paragraph style collection using SetCSS. If you saved the styles in *WP*CSS format you can also use ParStyles.LoadFromFile.
WPRichText1.Clear;
WPRichText1.ParStyles.SetCSS(
'.Normal{font-family:"Calibri";font-size:11.00pt;}' + #10+
'.Text{font-family:"Arial";font-size:10.00pt;}');
WPRichText1.LoadFromFile( 'test.html', false );