文書の数を数値で取得します。
var i = editor.documents.Count;
指定したインデックスの Document オブジェクトを取得します。
var doc = editor.documents.Item(index);