I tried your code, but when I use RichEditViewer.Lines.LoadFromFile, the file (an RTF) is displayed with a lot of characters like: {\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1040{\fonttbl{\f0\fnil\fcharset0 Calibri;}} {\*\generator Riched20 10.0.22621}\viewkind4\uc1\pard\sl240\slmult1\b\f0\fs22\lang16, \b0\par, \par,\pard\sl240\slmult1, in the entire document. I also noticed that with .txt files accented characters are displayed incorrectly. I tried using LoadStringFromFile(file, Ansidata), but the same thing happens. The same files are displayed correctly in the "normal" InfoBeforeFile.