Manage Learn to apply best practices and optimize your operations.

Retrieve selected documents

This piece of code helps in retrieving selected documents on the view or the currently opened document.

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 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



  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...