Extract imported image from richtext field

A Notes database has a form called Catalog Image which contains a Rich Text field named Image. Image files are imported into the Image field by the following script:

Dim ws As New notesuiworkspace

Dim uidoc As NotesUIDocument

Set uidoc=ws.CurrentDocument

Call uidoc.GotoField(“Image”)

Call uidoc.FieldClear(“Image”)

Call uidoc.Import

This opens an Import dialog box from which the user selects a JPG file from their hard drive and clicks Import to bring it into the Image field. The document is then saved.

What I want to do now is reverse the process–extract the image file from the Rich Text field and save it to my computer.

I can do this manually by right-clicking on the image and copying and pasting it into Microsoft Paint, then saving it as a JPG.

Is there a way to do this using an action on the form? I tried doing this in LotusScript, but couldn’t get an object reference to the imported image–

the EmbeddedObjects property of the Rich Text field was empty.

Subject: Extract imported image from richtext field

I suggest that you use DXL. This question has been asked and answered many times on this forum in the past.

Subject: RE: Extract imported image from richtext field

I posted a utility on my blog recently that does this with GIF images in a document (in this case it’s a document I created for the purpose of capturing the clipboard, but it would work with any document). You can do the same with JPEGs with a little tweaking.

  • Andre Guirard, IBM/Lotus Development

Useful blog: Best Practice Makes Perfect

For faster answers, be C R I S P Y