Learn how to a build a cloud-first strategyRegister Now


project's question...

Posted on 1998-02-17
Medium Priority
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 project..it looks like a bug to me..i can't save
a file .txt again as .rtf...:(
Question by:cooldude77
  • 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 100 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;

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

ID: 1359444
i am using white memo now..
i cannot use richtext..it'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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

810 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