-
Output to text file
Dear All,
Hope all are in fine tune.
Guys, I am in a problem. I am creating rather generating a report to a text file. Now what I want is that I want to make the first line (only the first line) of the report BOLD. Can anybody help me out? Or is it possible at all. Coz we know that a text file does not take the formatting for a single line.
Thanx in advance
Arghya
-
Re: Output to text file
Hi Arghya,
You could probably use a RichTextBox to hold the data, then make the first line bold and save the data as .txt (RichTextBox1.SaveFile "C:\test.txt").
Whilst you will see the formating data in amonst the .txt file, you will need to open it in say Word or similar to see the effects of the formating.
Or, if MS Word is installed on the target PC, you can save the Report as a .doc file using Word automation (with the first line bolded).
-
Re: Output to text file
Thanx Bruce. Now can u help me to show the view the text file from my application either in textbox or in rtf control with the proper formating by which I have created the text file
-
Re: Output to text file
Bold in a textbox will bold all the text - attributes are on a "whole textbox" basis. If you save the formatting (RichTextBox1.SaveFile "c:\test.rtf", rtfRTF) and read the file into an rtbox control, you'll see the formatting. Post #2 in this thread has an RTF tutorial.