获取视图中的第N个文档
Set vw = db.GetView("InfoPublishedByDate_View")
Set docTarget = vw.GetNthDocument(10)
为什么这样获取不到.请问下应该怎么获取.在线等```
[解决办法]
我想您的方法不对。你应该先得到一个文档集合,然后进行定位,并判断处于位置10的文档是否存在。
语法如下:
Syntax
Set notesDocument = notesDocumentCollection.GetNthDocument( n% )
实例代码:
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Set db = session.CurrentDatabase
Set collection = db.AllDocuments
Set doc = collection.GetNthDocument( 3 )
[解决办法]
Dim session As New NotesSessionDim db As NotesDatabaseDim view As NotesViewDim entry As NotesViewEntryDim vc As NotesViewEntryCollectionDim doc As NotesDocumentSet db = session.CurrentDatabaseSet view = db.getView("By Category")Set vc = view.GetAllEntriesByKey("Student")Set entry = vc.GetNthEntry(3)Set doc = entry.Document
[解决办法]
使用dc不行,会存在乱的情况
[解决办法]
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim entry As NotesViewEntry
Dim vc As NotesViewEntryCollection
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set view = db.getView("By Category")
Set vc = view.GetAllEntriesByKey("Student")
Set entry = vc.GetNthEntry(3)
Set doc = entry.Document
五楼正解。这个要常用,如果视图使用比较频繁,建议常用entry而非dc 效率会快很多,特别是在文档有附件的情况下。
[解决办法]