getAttachmentList (NotesXspDocument - JavaScript)

文書内の添付ファイルを取得します。

構文

getAttachmentList(fieldName:string) : java.util.List
パラメータ 説明
fieldName 添付ファイルを格納するアイテムの名前。
戻り値 説明
java.util.List 添付ファイル。各要素は NotesEmbeddedObject 型です。

以下の onclick イベントは、文書に添付されたすべてのファイルの名前を取得します。変数 requestScope.xml は、複数行が設定された編集ボックスにバインドされます。
var alist = document1.getAttachmentList("body");
if (alist.isEmpty()) {
	requestScope.alist = "No attachments"
} else {
	var result = alist.length.toString() + " attachments¥n";
	var alisti = alist.iterator();
	//	Each element is of type NotesEmbeddedObject
	while (alisti.hasNext()) {
		result = result + alisti.next().getName() + "¥n";
	}
	requestScope.alist = result;
}