add (NotesNoteCollection - JavaScript)

1 つ以上の文書を文書コレクションに追加します。

定義場所

NotesNoteCollection

構文

add(removalspecifier:NotesAgent) : void

add(removalspecifier:NotesDocument) : void

add(removalspecifier:NotesDocumentCollection) : void

add(removalspecifier:NotesForm) : void

add(removalspecifier:int) : void

add(removalspecifier:NotesNoteCollection) : void

add(removalspecifier:string) : void

add(removalspecifier:NotesView) : void

パラメータ 説明
removalspecifier 追加する文書。intstring の場合は、文書 ID です。それ以外の場合は、関連するオブジェクトです。

使用法

追加する文書の親データベースは、文書コレクションと同じでなければなりません。

このボタンは、現在のデータベース内の文書の文書コレクションを作成します。件名にテキスト「example」が含まれる文書をすべて削除し、修正されたコレクションを DXL としてエクスポートします。
// Open DXL file
var stream:NotesStream = session.createStream();
var filename:string = "c:¥¥dxl¥¥";
filename = filename + database.getFileName();
filename = filename.substring(0, filename.length() - 3) + "dxl";
if (stream.open(filename)) {
	requestScope.status = "Opened " + filename;
	stream.truncate();

	// Create note collection
	var nc:NotesNoteCollection = database.createNoteCollection(false);
	nc.buildCollection();
	
	// Add document if it contains word example
	var dc:NotesDocumentCollection = database.getAllDocuments();
	var doc:NotesDocument = dc.getFirstDocument();
	while (doc != null) {
		var  subject:string = doc.getItemValueString("Subject");
		if (subject.toLowerCase().indexOf("example") >= 0) {
			nc.add(doc.getNoteID());
		}
		var tmpdoc:NotesDocument = dc.getNextDocument(doc);
		doc.recycle();
		doc = tmpdoc;
	}

	// Export note collection as DXL
	var exporter:NotesDxlExporter = session.createDxlExporter();
	var output:string = exporter.exportDxl(nc);
	stream.writeText(output);
	stream.close();
	requestScope.status = requestScope.status + "¥n" + nc.getCount() +
		" notes written to " + filename;
} else {
	requestScope.status = "Cannot open " + filename;
}

言語間の参照

LotusScript® NotesNoteCollection クラスの Add メソッド

Java™ NoteCollection クラスの add メソッド