Help me understand the difference between embedobject and uidoc.import

Hi there,

I have an application that run in the notes client, and I’m trying to run a script that will embed a thumbnail image in the document.

If I use the embedobject method, the thumbnail gets embedded, but doesn’t display within the document; and I’m assuming this is because it’s an OLE object. If I run a script that uses the import method on the current uidoc, the thumbnail shows up the way I want it to.

I’m happy with the way the import method embeds the thumbnail, but the problem is that I want to do it on a document that’s not the current document – I want to do it on a different document.

I’m still learning lotus script, and up til now I’ve only done web programming; so all the NotesUI stuff is new to me. From what I can tell it looks like you can only access the current document.

So my question is two fold:

  1. Is there any way to get a jpeg to display within the document if it’s an OLE embedded object?

  2. Is there any way to use the import method on a document other than the current workspace document?

And if the answer to both of those questions is no, any suggestions on how to accomplish my goal?

Currently it goes through a forall loop of Keys and uses GetDocumentByKey to select the next document to embed the thumbnail on using the EmbedObject method

I’ve noticed alot of posts in the 5.X and 6 forums on this subject, and can’t seem to find a conclusive answer.

Thanks in advance,

Scott

Subject: Help me understand the difference between embedobject and uidoc.import

There’s not a good way to manipulate images in the back end, using just what LotusScript supplies. There are ways to work around this.

If you have the images already imported into a rich text field, you can use NotesRichTextItem.AppendRTItem to insert it into another rich text field. This works nicely if you have just a few images and you need to choose the appropriate one for the current document. The images can be kept in image catalog documents in a reference view (note: this is not a specific feature of Notes whose names you should recognize – just my way of describing forms and views that you would create, with documents sorted by a unique value, each containing a rich text field with one image in it).

Likewise, if you have an image catalog, you can make the image appear on the form not in a rich text item, by adding a CFD text field that uses @DbLookup to look up the rich text field that contains the image.

If the images are on a file server to which all users have access, you can make one appear on the form by using pass-thru HTML such as: . This string can be computed, of course, based on other fields in the document.

If the images only need to be visible to web users, you can use EmbedObject to attach a graphic file to a rich text field, then use the Domino URL format to refer to that file in passthru HTML elsewhere on the form. Techniques are discussed in technotes and these forums, for hiding the file attachment icon in the rich text field.

Thorough control of rich text can be achieved using the Notes C API, or if you want an interface that’s easy to call from script, try the Midas rich text LSX from www.geniisoft.com.

Elaborate kludges are possible using a combination of front-end and back-end functionality. This is probably more trouble than you want to go to. But if you’re running the code on a Notes client, there are lots of tricks you can do involving dialog boxes, the clipboard, special-purpose forms that contain postopen code, and so on.