Working with an embedded object in Java classes

Use getEmbeddedObjects of RichTextItem to get a vector of EmbeddedObject objects containing all the embedded objects, linked objects, and file attachments in a rich text item. Use hasEmbedded of Document to see whether a document contains any embedded objects.

Note: Embedded objects and object links are not supported for OS/2, UNIX, and the Macintosh. File attachments are.

To get all the embedded objects in a document, including objects that were originally embedded in the form from which the document was created, use getEmbeddedObjects of Document.

To locate pre-Release 4 file attachments not associated with a rich text item, get all the items in the document, for example, by using getItems of Document. Test getType property of each item for Item.ATTACHMENT. To get an attachment of this type, use getAttachment of Document.

You access EmbeddedObject properties through the following methods:

  • getClass returns a String value containing the name of the application that created the object (does not apply to attachments).
  • getFileSize returns an int value containing the size of the object (does not apply to embedded and linked objects).
  • getInputSource reads an attachment and creates a SAX InputSource for the contents of the object.
  • getInputStream reads an attachment and creates an InputStream for the contents of the object.
  • getName returns a String value containing the name used to reference an object that was embedded programmatically.
  • getObject returns an int value containing the OLE handle for the object.
  • getParent returns a RichTextItem object representing the item that contains the object.
  • getReader reads an attachment and creates a Reader for the contents of the object.
  • getSource returns a String value containing the file name or OLE syntax for the source document/item of the embedded object.
  • getType returns an int value containing the type of the object: EmbeddedObject.EMBED_OBJECTLINK, EmbeddedObject.EMBED_ATTACHMENT, or EmbeddedObject.EMBED_OBJECT.
  • getVerbs returns a vector of String objects representing the verbs that an OLE/2 embedded object supports.

EmbeddedObject has the following methods:

  • activate causes OLE to load the object and returns a handle to the OLE object (on systems supporting OLE).
  • doVerb executes an object verb (on systems supporting OLE).
  • extractFile copies a file attachment to a file.
  • parseXML parses the contents of an attachment and creates a DOM tree, using the validating or non-validating DOMParser.
  • remove removes the object from its rich text item. You must call save of Document to implement the removal in storage.
  • transformXML transforms the contents of an attachment, using a Domino® Item, RichTextItem, EmbeddedObject, or MIMEEntity stylesheet, or any InputSource stylesheet.