[EMAIL PROTECTED] wrote:
The .htm trick helped a little, but not enough. It didn't work at
all when I tried MS Word.
However, it destroyed the line-feed character so I had to enter that
manually for each line, since I'm forming the lines in the I-O buffer rather than
in a variable string, and I can't use a constant value. It also seemingly
randomly ignored parts of some of the elements, leaving < and > all over the
page. It printed a couple of lines twice and wouldn't take CSS elements. I'm
not good enough at HTML to figure out what isn't working, nor to get around the
deprecated features, so I'm sort of stuck.
Isn't there a list of text-formatting codes used by OO? At least the
most commonly used features - bold, italic, font-face, font-size, underlined? I
really don't want to involve the HTML editor if I don't have to. Thanks.
Best,
Carl
OOo natively loads and saves XML files. Create a very simple file, save
it as a standard OOo Writer .odt file. Change the file extension to
.zip. Extract the files within the zip archive. What you see is the
actual text-formatting codes and files that OOo Writer uses when reading
in a file.
OOo doesn't use a straightforward character byte stream, but rather a
number of XML files. You can, of course, create your own OpenDocument
files either manually or programatically. But, personally, I think HTML
is easier, particularly when you mostly only want formatting that sits
on top of whatever is already specified in the document in which you are
inserting the file. You code the minimum.
LF values are normally ignored by HTML readers. You can begin your HTML
with the <PRE> directive to avoid this if you want.
Here is some sample HTML:
=================================================================
<PRE>The <I>quick</I> brown fox <SUP>jumps</SUP> over the <B>lazy<B> dog.
Now is the time for all <U>good men</U> to come to the aid of the party.
End
======================================================================
OOo Writer reads it and displays it perfectly (if you want a fixed pitch
font display.)
Or instead use:
=====================================================================
<P>The <I>quick</I> brown fox <SUP>jumps</SUP> over the <B>lazy<B> dog</P>.
<P><BR></P>
<P>Now is the time for all <U>good men</U> to come to the aid of the
party.</P>
<P><BR></P>
End
=====================================================================
You can get more complex:
=====================================================================
<FONT FACE="Times New Roman, Times, serif"; SIZE=3">
<P STYLE="margin-bottom: 0in; line-height: 200%">Now is the <I>time</I>
for all <SUP>good</SUP> men to come to the <B>aid</B>
of the party.</P>
<P STYLE="margin-bottom: 0in; line-height: 200%">
The quick <I>brown</I> fox <U>jumps</U> over the <B>lazy</B> dog.</P>
<P STYLE="margin-bottom: 0in; line-height: 200%">End</P></FONT>
=====================================================================
Yes, CSS coding is ignored by OOo. So don't use it. You said you wanted
things kept simple. Consider this not real HTML, but OOo's own code.
That many of the ways it does things are now deprecated in HTML don't
matter at all from that point of view.
Switching to source code view allows you to make that "list of
text-formatting codes used by OO" that you want and also shows you at
least one way to do *exactly* what you want to do without guessing.
Use Writer to create the text and formatting you want, save it as HTML,
and OOo will create the HTML code to do what you want for you. You may
want to edit it to make it more efficient and more structured. But you
don't have to. You don't even have to understand most of it if you don't
want to. Just take what works and wrap it around your data.
What could be easier?
And you can use Insert -> File to insert a OOo-compatible HTML file into
a OOo Writer document without going into the HTML editor.
You can do this programatically using the OOo programming function
insertDocumentFromUrl().
Similarly you can do this in MS Word in VBA using
.ActiveDoc.selection.InsertFile(m.tcTabFile)
It works wonderfully.
At work we were using automated MS Word as the output formatter for
reports produced from HTML files created on the fly programatically by
wrapping HTML around database output. We now use OpenOffice.org Writer
for the same purpose, using it instead of MS Word as the automated
terminus for such reports. HTML does work, and works well.
Another possiblity would be to code in RTF, manually or programatically.
But I think OOo-HTML is far easier. And it does work.
I'm not sure what you mean by "I'm forming the lines in the I-O buffer
rather than in a variable string, and I can't use a constant value." But
some of the difficulties you are having may have to do with the input
method you are using.
Jallan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]