Results 1 to 4 of 4

Thread: Output to text file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2005
    Posts
    174

    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

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    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).

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2005
    Posts
    174

    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

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    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.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width