Embedding jpegs

I just cant figure this one out…I have a form with a button and a RT field called “Body”…

in the button I have:

Dim s As New NotesSession

Dim db As NotesDatabase

Dim doc As NotesDocument

Dim rtItem As NotesRichTextItem

Dim object As NotesEmbeddedObject

Dim imageChoice As Variant

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set db = s.CurrentDatabase

Set uidoc = ws.CurrentDocument

Set doc = uidoc.Document

imageChoice = ws.OpenFileDialog ( True, “Choose Images”, “JPG Images|.jpg|GIF Images|.gif”, “C:\Pics” )

Set rtItem = New NotesRichTextItem ( doc, “Body”)

Set object = rtItem.EmbedObject ( 1453, “”, imageChoice(0), “” )

Call doc.Save ( True, True )

What’s happening is the selected images(can be multiple) is being put in to the document, but not in the desired field to view.

I see in the doc properties a lot of $File entries… but I just don’t know how to make this work.

I’ve view the 6,7, and 8 forums and I see nothing that can help. Examples that appears to be close…don’t work…

The overall result, is to open a directory… view all the images…select mulitple images,

and put them in a field. (then resize then down 60%)…

right now… I can’t even get them to embedded without doing the manual…create, picture… off the tool bar…

Anyone care to guide me?

~Brett

Subject: There’s a difference between attaching a file and embedding an image.

You’re taking on a difficult task.

To learn about attaching files to a document you’re editing, read this: How to use LotusScript to create a file attachment in the front end.

The back-end support for working with embedded images is basically nonexistent. You can only do it by creating DXL to import. There’s code in the LotusScript Gold Collection to do this, but doing it to a document that’s open on screen is a little bit problematic, and importing rich text is still a bit lossy (not as bad as earlier versions but not improved all that much as yet). You won’t lose text or formatting or images, but if you have any buttons or layers or other odd things, it might lose some options.

The easiest way to get images embedded into your front-end rich text in the first place is with the NotesUIDocument.Import method. This will not, however, let you scale the images as you describe, though one of the libraries in the above link will let you do so with DXL. BTW, is there a reason you don’t scale the images first, and then import them? You would need to find some outside code to do the scaling, but I’m pretty sure you could find something free.

Subject: images…

The reason why I wan’t to resize them…is the regular end user doesn’t know how or refuses to…So i try to take care of it for them.

Using the richtext lite works exactly what I’m looking for… but I can only do one image at a time…

nuts!