project's question...

Posted on 1998-02-17
Last Modified: 2010-04-04
how to save a file  like .txt and
then let the user save as another format from the
  save file dialog such as .rtf, (all files)..etc?
  thus if i first save as .txt extension like jack.txt
 and then i save the same file as jack.rtf..the
  content of the 2 files will be the same and
  now i have jack.txt and jack.rtf... i am doing this feature
for my looks like a bug to me..i can't save
a file .txt again as .rtf...:(
Question by:cooldude77
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3

Expert Comment

ID: 1359441

Do you want this:

1 - You have a text in TRichEdit.
2 - When user selects .txt from savedialog you want to save it as text and put extention '.txt' to the end of filename.
3 - When user selects .rtf from savedialog you want to save it as REAL, ACTUAL rich text format and put extention '.rtf' to the end of filename.

Make clear these out please,
I am sure the problem is simple but we can not apprehend

Author Comment

ID: 1359442
yeah..u got my point..
if the user has a text file , he can also save it
as rich edit format..but the filename renames the same..
like jack.txt, jack.rtf

Accepted Solution

inter earned 50 total points
ID: 1359443

If you use Delphi 2.0+

1 - Put TRichEdit instead of TMemo in your MdiClient windows. OK?
2 - When the file extention is '.txt' (I am sure you now this now) save it as following (assume Trichedit instance is Editor)

  Editor.PlainText := True;
3 - When the file extention is '.rtf'  save it as following (assume Trichedit instance is Editor)

  Editor.PlainText := False;

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 1359444
i am using white memo now..
i cannot use's part of the project requirement..


Expert Comment

ID: 1359445
That bad news friend?

I wonder, who require you to do such a thing with TMemo? However it can be done for VERY plain text files manually. I once do it, but not that easy. Do you know file operations (opening streams, writing in them, formatting text?)? If not, I am sorry you'd better force the guy gives the project to use rich edit.

Comment Please

Author Comment

ID: 1359446
there is no way to do it?

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question