Aug 24, 2012 Dear All, I am new in Lotus Notes, I am trying to extract the inline image in richtext from the record in database. I try to convert the content to mime with the method with the script open NoteIDDocument and save the record again.
Active4 years, 3 months ago
I'm having issues to extract inline images that are pasted in the email body if the emails are sent from external email (like gmail for example) into the Lotus notes.
The emails which are sent from Lotus Notes itself has no issues and I'm able to retrieve the inline images by using the
document.generateXML()
method and parsing through <picture>
tag the stream.My real concern is how to extract from the external emails (like gmail).
bluish15.2k1919 gold badges9696 silver badges155155 bronze badges
user1660645user1660645
3 Answers
This is a known issue in that a MIME inline attachment is not the same as a Notes attachment. When the mail comes in, if the File component is over a certain size it will create a $FILE you can interact with.
However in some cases, or low file size this attachment remains within the MIME data. Which you can't get to with the Java API.
You can tell the server to force attachments to be stored as $FILE by using the following notes.ini setting.
This will only change new mails coming in. Also it will treat every object that is not text and inline as an attachment. So images may also be converted.
Simon O'DohertySimon O'Doherty8,26211 gold badge2222 silver badges4545 bronze badges
You can copy the image into another program (e.g. Paint, Ifranview) if you edit the Email. Steps:
snowboundsnowbound1,02222 gold badges1414 silver badges2525 bronze badges
Copy and paste seems to work for images if you open the message in a new window
Right click on the message and select 'Open in New Window'. Now right click on the image and select copy.Now you can Paste the image into paint, Word etc. I have lotus notes 8.5 and this works for me
user4916717user4916717
Not the answer you're looking for? Browse other questions tagged lotus-noteslotus-domino or ask your own question.
Active2 years, 11 months ago
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
casperOne66.4k1414 gold badges161161 silver badges228228 bronze badges
Emil RasmussenEmil Rasmussen55011 gold badge44 silver badges1919 bronze badges
9 Answers
I'd suggest looking at Midas' Rich Text LSX (http://www.geniisoft.com/showcase.nsf/MidasLSX)
I haven't used the personally, but I remember them from years ago being the best option for working with Rich Text. I'd bet it saves you a lot of headaches.
As for the NotesMIMEEntity class, I don't believe there is a way to convert RichText to MIME, only MIME to RichText (or retain the MIME within the document for emailing purposes).
Ken PespisaKen Pespisa19.8k33 gold badges4848 silver badges6060 bronze badges
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:
D.BuggerD.Bugger
If you upgrade to Notes Domino 8.5.1 then you can use the new
ConvertToMIME
method of the NotesDocument
class. See the docs. This should do what you want.Alternativly the easiest way to get the Domino server to render the RichText will be to actually retrieve it via a url call. Set up a simple form that just has the RichText field and then use your favourite HTTP api to pull in the page. It should then be pretty straight forward to pull out the body.
KerrKerr
Here is how I did it, using the OpenField command, see D.Bugger's post above
Casper SkovgaardCasper Skovgaard
You can use the NotesDXLExporter class to export the Rich Text and use an XSLT to transform the output to what you need.
CarlosCarlos1,00111 gold badge1010 silver badges1717 bronze badges
I know you mentioned using LotusScript, but if you don't mind writing a small Java agent (in the Notes client), this can be done fairly easily - and there is no need to modify the existing form design.
The basic idea is to have your Java code open a particular document through a localhost http request (which is simple in Java) and to have your code capture that html output and save it back to that document. You basically allow the Domino rendering engine to do the heavy lifting.
You would want do this:
- Create a form which contains only the rich-text field you want to convert, and with Content Type of HTML
- Create a view with a selection formula for all of the documents you want to convert, and with a form formula which computes to the new form
- Create the Java agent which just walks your view, and for each document gets its docid, opens a URL in the form http://SERVER/your_database_path.nsf/NEW_VIEW/docid?openDocument, grabs the http response and saves it.
I put up some sample code in a similar SO post here:
Community♦
Ed SchemborEd Schembor4,85066 gold badges2626 silver badges3737 bronze badges
Keep it simple.
Change the BODY field to Store contents as HTML and MIME
Open the doc in editmode.Save.Close.
You can now use the NotesMIMEEntity to get what you need from script.
Stephen Lawrie - New ZealandStephen Lawrie - New Zealand
Casper's recommendation above works well, but make sure the ACL is such to allow Anonymous Access otherwise your HTML will be the HTML from your login form
David KDavid K
If you do not need to get the Richtext from the items specifically, you can use ?OpenDocument, which is documented (at least) here: https://www.ibm.com/developerworks/lotus/library/ls-Domino_URL_cheat_sheet/https://www.ibm.com/support/knowledgecenter/SSVRGU_9.0.1/com.ibm.designer.domino.main.doc/H_ABOUT_URL_COMMANDS_FOR_OPENING_DOCUMENTS_BY_KEY.html
OpenDocument also allows you to expand sections (I am unsure if OpenField does)
Syntax is:http://Host/Database/View/DocumentUniversalID?OpenDocument
But be sure to include the charset parameter as well - Japanese documents were unreadable without specifying utf-8 as the charset.
Here is the method I use that takes a NotesDocument and returns the HTML for the doc as a string.
Jason ShulerJason Shuler