Page 1 of 1 1
Topic Options
#180551 - 2007-09-13 06:15 PM Formatting Text File with Writeline
danilda Offline
Fresh Scripter

Registered: 2006-03-01
Posts: 21
Loc: Washington, DC
I would like to send basic formatting (bold, underline, color) to text that is being written to a text file using writeline.

thanks -- dee

Top
#180553 - 2007-09-13 06:29 PM Re: Formatting Text File with Writeline [Re: danilda]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Writeline will write plain text. It has no options for formatting build inn.

You coud write a html file with writeline. This will give you formatting. I guess rtf is also possible but html is easier to make an example.

 Code:
Break on

$rc = Open (1, "c:\example.htm", 5)

$rc = WriteLine(1, "<font color=red face=Verdana size=3>" + @CRLF)
$rc = WriteLine(1, "Test." + @CRLF)
$rc = WriteLine(1, "<br>" + @CRLF)
$rc = WriteLine(1, "Hello this is a test html file using writeline in kixtart." + @CRLF)
$rc = WriteLine(1, "</font>" + @CRLF)
$rc = WriteLine(1, "<br>" + @CRLF)
$rc = WriteLine(1, "<H1>" + @CRLF)
$rc = WriteLine(1, "A big line." + @CRLF)
$rc = WriteLine(1, "</H1>" + @CRLF)

$rc = Close(1)


Edited by Mart (2007-09-13 06:33 PM)
Edit Reason: Oops, posted a lie. Ripped it out.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#180608 - 2007-09-14 12:51 PM Re: Formatting Text File with Writeline [Re: danilda]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Is this text really "text" (ansi, ascii) or is it per example a Word document?
In real text (that you open with notepad or DOS Edit) you cannot underline, set bold etc...
Or like Mart suggested, is it about a html page?

Top
#180622 - 2007-09-14 05:31 PM Re: Formatting Text File with Writeline [Re: Witto]
danilda Offline
Fresh Scripter

Registered: 2006-03-01
Posts: 21
Loc: Washington, DC
I am placing text in a text file that will then be used via blat to e-mail to individuals. Blat puts the contents of the file in an e-mail and I wanted to give it some formatting to highlight certain portions.
Top
#180623 - 2007-09-14 05:49 PM Re: Formatting Text File with Writeline [Re: danilda]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
 Originally Posted By: danilda
I am placing text in a text file that will then be used via blat to e-mail to individuals. Blat puts the contents of the file in an e-mail and I wanted to give it some formatting to highlight certain portions.


In that case you will need to decide which format to use - HTML or "rich text" is about the only ones that you can sensibly use - and create the file in that format.

You then tell BLAT the MIME file type and send it.

HTML is going to be by far the easiest type to code, so long as the recipients' mail reader can understand it - after you create the HTML file just submit it to blat with the "-html" flag.

You could try searching the BLAT mailing list for more examples / help: http://tech.groups.yahoo.com/group/blat/

Top
#180624 - 2007-09-14 08:25 PM Re: Formatting Text File with Writeline [Re: Richard H.]
danilda Offline
Fresh Scripter

Registered: 2006-03-01
Posts: 21
Loc: Washington, DC
Thanks for your help.

dee

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1471 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.139 seconds in which 0.103 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org