Insert image in a rich text field

Hello,

I want to insert an image in a rich text field. Image should be inserted in the open mode. To do this I have writen the following code :

@Command([EditGotoField];“fldName”);

@Command([EditInsertFileAttachment])

by doing this image is inserted in the rich text field with file type icon(for e.g. jpeg,doc, excel) and file name. User have to click on the file icon to view/open the image.

Instead i want the image should be inserted in the field in open mode.

Client’s requirement is : A form that containts the personal details of the person. In a right corner the person image should be visible along with his/her details.

Please suggest me the right approach to do this.

Thanks in advance

Suchita

Subject: Insert image in a rich text field

Save your document without the image, then edit it.

Sub Click(Source As Button)

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Call uidoc.GotoField(“Body”)

Call uidoc.Import(“BMP Image”, “c:\Windows\picture.bmp”)

End Sub

Subject: RE: Insert image in a rich text field

Thanks Mike and doug…

It is working fine…excatly the same thing i wanted…I have one more query now…image is getting inserted in its actual size which is very large and covering the whole page. Instead the whole page i want the image should be displayed in a specified area.

Which is possible by

  • right click on the image and select picture property.

  • set the scaling % ti adjust the image size.

I want the same thing programitically.

any sugessions please…

Thanks

Subject: Probably not so easy … you could try to go the Java or DXL-way, or try other tools such as “Import Image 2 Lotus Notes”

Whether something is easy or not, is often up to the person who will implement the stuff to say :slight_smile: Unfortunately the image handling in Notes are somewhat cumbersome. You can however do image resizing via Java with pretty good quality, or you can export the image to DXL, extract the base64-encoded image, and perform actions on it. All this is available in standard Notes - but not necessarily as easy as one would like. Search this forum and the web for stuff like “Java and Image” etc.

If a third-party solution is an option, you could head over to my site to read more about “Import Image 2 Lotus Notes” product,(Voith's CODE :: Import Image 2 Lotus Notes) which let you import and manipulate images via LotusScript in many ways!

Bob, Author of II2LN

Subject: RE: Insert image in a rich text field

FWIW,you don’t need to save the doc first, this code works in a brand new doc.