if ActiveRVE.ItemCount-1 > 0 then
ActiveRVE.DeleteItems(ActiveRVE.ItemCount-1,1);
ActiveRVE.Format;
Is there another way to call InsertRVFFromStream or some other or better way to handle that extra line or item or whatever it is that always seems to be added?
1) InsertRVFFromStream is not an editing-style method; it simply inserts content at the specified position.
And it does not reformat the affected part of the document; that means that the final call of Format is necessary.
2) When you format an empty TRichViewEdit, a blank line is added.
As a result:
When you call Format before InsertRVFFromStream, a blank line is added. You insert RVF at the beginning of the document (because 0 is specified in the parameter of InsertRVFFromStream), so this blank line remains after the inserted content.
So, delete the first call of Format, and call Format only at the end.
PS: If you used InsertRVFFromStreamEd instead of InsertRVFFromStream, the advice would be the opposite.
This is an editing method, so it requires a formatted document before its call, so the first call of Format is required.
The last call of Format is not needed, because InsertRVFFromStreamEd reformats the changed part of the document itself.