Search code examples
lotus-noteslotusscriptdomino-designer-eclipse

Notes EMBEDDEDOBJECT (1090) doesn't return an inline image


The following article Notes items gives the description of all Notes items. It is mentioned that EMBEDDEDOBJECT (1090) means embedded object. Yet, my code doesn't work for this part.

Following is the piece of code to extract the image:

If edoc.HasEmbedded Then
ForAll x In edoc.items
    If x.Type = 1090 Then
    Set neoAttachment = edoc.GetAttachment(x.values(0))
    strImageFilepath = Temppath & neoAttachment.name
    Call neoAttachment.ExtractFile(strImageFilepath)
    Set Attachobject = rititem.EmbedObject( EMBED_ATTACHMENT, "", strImageFilepath)
    End If
End Forall

If I specify as x.Type=1090, then the inliine image doesn't get extracted.

But if I specify as x.Type=1084(which means file attachment), in the same piece of code, it works.

Inline image is supposed to be an embedded object and not an attachment. Could anyone please tell the reason for this issue?


Solution

  • The Notes architecture has evolved over time, and the vocabulary is a bit... Ummmm... difficult.

    An embedded object can be either an attachment or an OLE object. There are (normally) two parts to an embedded object: a piece of data that marks the place where the object appears in NotesRichTextItem, and a separate piece of data that stores the actual bits for the object. In both cases, the marker is accessed through the NoteRichTextItem and is referred to as an embedded object, but the actual bits are stored in their own separate NotesItem, outside of the NotesRichTextItem. The NotesEmbeddedObject class works with both parts, and tries to hide the existence of the second item from you, but it's always there.

    Type 1090 would be an embedded OLE object. In the case of an embedded object that is an inline image, the NotesItem object is stored as a file attachment, type 1084.