添付ファイルを表すものを返します。
パラメータ | 説明 |
---|---|
filename | 添付ファイルのファイル名です。 |
戻り値 | 説明 |
---|---|
NotesEmbeddedObject | 添付ファイルを表すものを返します。指定された名前の添付ファイルがない場合は、null を返します。 |
返された NotesEmbeddedObject の Parent プロパティは、NotesRichTextItem を使用してアクセスされたものではないため、null を返します。
try {
var dc:NotesDocumentCollection = database.getAllDocuments();
var doc:NotesDocument = NotesDocument = dc.getFirstDocument();
while (doc != null) {
var obj:NotesEmbeddedObject = doc.getAttachment(requestScope.query);
if (obj != null) {
requestScope.status = "Found " + obj.getName() + " in ¥"" +
doc.getItemValueString("Subject") + "¥"";
break;
}
var tmpdoc = dc.getNextDocument();
doc.recycle(); // recycle to avoid memory problems
doc = tmpdoc;
}
if (!requestScope.status.startsWith("Found")) {
requestScope.status += "¥nDid not find attachment"
}
} catch(e) {
requestScope.status = e.toString();
}