Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export Rich Text fields as HTML from Notes with LotusScript?

I'm working on a data migration task, where I have to export a somewhat large Lotus Notes application into a blogging platform. My first task was to export the articles from Lotus Notes into CSV files.

I created a Agent in LotusScript to export the data into CSV files. I use a modified version of this IBM DeveloperWorks forum post. And it basically does the job. But the contents of the Rich Text field is stripped of any formatting. And this is not what I want, I want the Rich Text field rendered as HTML.

The documentation for the GetItemValue method explicitly states that the text is rendered into plain text. So I began to research for something that would retrieve the HTML. I found the NotesMIMEEntity class and some sample code in the IBM article How To Access HTML in a Rich Text Field Using LotusScript.

But for the technique described in the above article to work, the Rich Text field need to have the property "Store Contents as HTML and MIME". And this is not the case with my Lotus Notes database. I tried to set the property on the fields in question, but it didn't do the trick.

Is it possible to use the NotesMIMEEntity and set the "Store Contents as HTML and MIME" property after the content has been added, to export the field rendered as HTML?

Or what are my options for exporting the Notes database Rich Text fields as HTML?

Bonus information: I'm using IBM Lotus Domino Designer version 8.5

like image 860
Emil Rasmussen Avatar asked Nov 28 '22 05:11

Emil Rasmussen


1 Answers

There is this fairly unknown command that does exactly what you want: retrieve the URL using the command OpenField.

Example that converts only the Body-field:

http://SERVER/your%5Fdatabase%5Fpath.nsf/NEW%5FVIEW/docid/Body?OpenField
like image 147
D.Bugger Avatar answered Dec 05 '22 02:12

D.Bugger