From: Tim X on
Francogrex <franco(a)grex.org> writes:

> Lisp in windows:
> (with-open-file (stream "c:/test.doc" :direction :output)
> (format stream "Only testing word doc generation"))
>
> ok the test.doc generated is only a plain text and not a real MS-WORD
> doc.
> also:
> (with-open-file (stream "c:/test.xls" :direction :output)
> (format stream "Only testing MS-Excel generation"))
> ok the test.xls is only a plain text and not a real Excel document
> (despite the extension)
>
> Anyone knows a way to make CL (any implementation) generate native MS
> documents? Or is this not related to CL or any of its implementations
> but to some obscure mechanism of the OS?
> (I know that the answers to such questions are unlikely because most
> users are linux, but...)

Don't even bother going down that road. Even if you are able to reverse
engineer any proprietary standard, it is likely to change next release
and then you have to update your software. It also means that only MS
word users will be able to access your generated documents. Best not to
artificially restrict your possible user based to only word users in the
first place.

Better solution would be to generate documents in a format that is
kaccessible to word users and hopefully users of other programs and
maximise your audiance. I'd suggest looking at the open document format
(ODF) as I believe later versions of word can access this format, as can
other software, such as open office. I think this format is XML based,
so it will likely be easier to generate than a reverse engineered binary
format which your unlikely to ever fully comprehend.

Tim


--
tcross (at) rapttech dot com dot au
From: Francogrex on
Well from bits and pieces of comments, how about html? Something like
(not optimal but better than plain txt files):

(with-open-file (str "c:/test.doc" :direction :output)
(format str "
<html>
<body>
<p>
<a href=\"http://www.w3schools.com/html/default.asp\">HTML Tutorial</
a>.<br />
Each table starts with a table tag.
Each table row starts with a tr tag.
Each table data starts with a td tag.
</p>

<h1 style=\"text-align:center\">This is heading 1</h1>
<table border=\"1\">
<tr>
<td>100</td>
</tr>
</table>

<h4>One row and three columns:</h4>
<table border=\"1\">
<tr>
<td>~A</td>
<td>200</td>
<td>300</td>
</tr>
</table>

<h4>Two rows and three columns:</h4>
<table border=\"1\">
<tr>
<td>100</td>
<td>200</td>
<td>300</td>
</tr>
<tr>
<td>400</td>
<td>500</td>
<td>600</td>
</tr>
</table>

</body>
</html>" 'DATA))

From: Jerry Boetje on
On Jan 30, 4:55 am, Francogrex <fra...(a)grex.org> wrote:
> Well from bits and pieces of comments, how about html? Something like
> (not optimal but better than plain txt files):
>
In CLforJava, we've had success in turning the docs into an XML format
(we actually store in XML form). To display the docs, we use a variety
of XSL transforms for display (plain text, html). I haven't looked
around beyond these, but I'll bet that you will find some XSL
templates that could generate OpenDocument or other formats.
From: Norbert_Paul on
Francogrex wrote:
> Lisp in windows:
> (with-open-file (stream "c:/test.doc" :direction :output)
> (format stream "Only testing word doc generation"))
>
> ok the test.doc generated is only a plain text and not a real MS-WORD
> doc.
> also:
> (with-open-file (stream "c:/test.xls" :direction :output)
> (format stream "Only testing MS-Excel generation"))
> ok the test.xls is only a plain text and not a real Excel document
> (despite the extension)
>
> Anyone knows a way to make CL (any implementation) generate native MS
> documents? Or is this not related to CL or any of its implementations
> but to some obscure mechanism of the OS?
> (I know that the answers to such questions are unlikely because most
> users are linux, but...)

This might be, what you are looking for:

http://albert.sourceforge.net/

I didn't test it, but the autors claim that is can output html.
This would then be even better than M$-Word. But if you insist anyhow---
I know that Word can convert single html-files into .doc-files. Maybe
that even works with an entire website as generated by albert.

Regards
Norbert