Export rich text to HTML
Posted on 2002-03-08
I have a form that has a number of fields on it including ID, Title and Body. ID and Title are text, Body is rich text.
For the sake of this post, say we have a record where ID is ABCDEF, Title is Mongoose, and Body is:
The <B>mongoose</B>, genus <I>Herpestes</I>, is fast enough to capture and kill venomous snakes.
Please note that for this example I've used html tags for the bold and italics, where in the Notes document they would just be bold and italic as part of the rich text.
On form close, I would like to create an html file in a given directory named ABCDEF.html, with something like this in it:
<p>The <B>mongoose</B>, genus <I>Herpestes</I>, is fast enough to capture and kill venomous snakes.
The plan is, these html files will eventually be collected and squished into a .chm file. The challenge here is getting Notes to convert the contents of one rich-text field to the appropriate HTML tags, and I don't even really know where to begin.
The rich text field wouldn't contain any heavy formatting, such as for indentation. There wouldn't be any tables, though there might be bulleted lists. It would also be nice to be able to recognize a specific font style to interpret as, say, an <H3> in the middle of the text.
Of course, there would be other fields on the form that would not be included in the exported html.
Is this possible? I'll gladly throw more points at it depending on the complexity of the solution.
Thanks -- Barry Tice