RichEdit Plaintext value and SaveDialog

When using a SaveDialog component you can use filters, I use two, Rich Text Format *.rtf, and Plain Text Format *.txt. how do I make it so when I click on *.txt the value "plaintext" from the Richedit component becomes true, and equally when saving a *.rtf extension it is false?
Who is Participating?
erajojConnect With a Mentor Commented:
You could ofcourse use the filterindex value but then you
wouldn't be sure.
To be really sure you have to check the extension:
  with SaveDialog1 do if Execute then begin
    RichEdit1.PlainText := CompareText(ExtractFileExt(FileName), '.rtf')<>0;

/// John

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.