This piece of code helps retrieve selected documents on the view -- for example, if you would like to run a process for document(s) selected at a particular view. Thus, when only one document is selected, it will be checked as to whether it has been opened, or actually been selected through the currently opened view.
To get the list of selected documents in the view:
Set doccoll = db.UnprocessedDocuments If doccoll.Count = 0 Then Msgbox "Please select at least one document to be processed!", MB_ICONSTOP, db.Title Exit Sub Elseif doccoll.Count = 1
Then to verify the document has actually been "ticked" at the side of the view:
Set doc = uiDoc.Document vFlag = doc.IsUIDocOpen If vFlag = True Then Else Msgbox "Please select at least one document to be processed!", MB_ICONSTOP, db.Title End End If Else Set doc = doccoll.GetFirstDocument End If
Do you have comments on this tip? Let us know.
This tip was submitted to the SearchDomino.com tip exchange by member TY. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.
Dig Deeper on LotusScript
LotusScript creates drag and drop interface in Lotus Notes client
LotusScript to create a dynamic tabular report from a Lotus Notes document collection
LotusScript equivalent of @DBLookup and @DBColumn for Lotus Notes and Domino Server
LotusScript to create repeating reminders in a Lotus Notes calendar