How to write script to refer the selected UIView document?

Dear all,

How to write script to refer to the selected UIView documents. I have written the script as below, but it always prompt “Type Mismatch” error message.

If I change the line “Set dc = uivw.documents” to “Set dc = db.AllDocuments”, it prompt ’ “Alldocuments” not a member’ error message.

Dim ws As New NotesUIWorkspace

Dim ss As New NotesSession

Dim db As NotesDatabase, pdb As NotesDatabase

Dim uivw As NotesUIView

Dim doc As NotesDocument, newdoc As NotesDocument

Dim dc As NotesDocumentCollection

Set db = ss.CurrentDatabase

Set uivw = ws.CurrentView

Set dc = uivw.Documents

svr$ = db.server

Set doc = dc.getfirstdocument

Do while not doc is nothing

Set doc = dc.getnextdocument

Loop

Subject: How to write script to refer the selected UIView document ?

To use the selected documents in a view, you should use the UnprocessedDocuments property of the NotesView

Mike

Subject: RE: How to write script to refer the selected UIView document ?

Alternatively, if you are only interested in the document that is on focus (has the bold caret around it), you can use

NotesUIView.CaretNoteID

to retrieve the docments NoteID, which in turn can serve as input to NotesDatabase.GetDocumentbyID.