getAttachment (Document - Java)

Returns a representation of a file attachment. You can use this method to find file attachments that are not contained in a rich text item (such as an attachment in a Release 2 database) as well as file attachments that are contained in a rich text item.

Defined in

Document

Syntax

public EmbeddedObject getAttachment(String filename)
    throws NotesException

Parameters

String filename

String. The file name of the file attachment.

Return value

EmbeddedObject

A representation of the file attachment. Returns null if an attachment by the specified name is not found.

Usage

The Parent property for the returned EmbeddedObject returns null, since it was not accessed through a RichTextItem.

Example