Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formatting data in output file 2

Status
Not open for further replies.

osurfc

Technical User
Mar 28, 2006
20
US
I have an application that creates a text file with information from several different tables. I currently create a recordset for each table and place the data in the appropriate order via
Open "C:\MArk\test.doc" For Output As #1 Len = 82
Print #1, " B. DEMOGRAPHICS"

Print #1, "Patient Last Name: "; rstBasic!B_LastName; " Patient First Name: "; rstBasic!B_FirstName

Print #1, "Medical Record: "; rstBasic!B_MedRec; " Account Number: "; rstBasic!B_Account

Print #1, " "

Print #1, " C. Hospitalization"
Is there a way to Bold the category lines B. Demographics, C. Hospitalization, etc and change the font for the actual field data

Thanks
Mark

 
osurfc said:
Is there a way to Bold the category lines .......... etc and change the font
You are creating a simple text (ASCII) file, not rich-text file that supports any sort of formatting tags. Putting a ".doc" extension on the file name does not turn it into a Word document (just as putting a ".jpg" extension would not magically transform it into a graphic).

The one way you might put formatting in text file is to use HTML tags (e.g. <b>Bold</b>) and save it as an HTML/HTM document. Then if you opened it in Word (or a browser) it might look like what you want.

Otherwise you need to create the document with an application that can create a rich-text document. If you have Word on your computer you can use it (through OLE Automation) - jozino01 has shown you a bit of sample code.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top