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

SearchWindowsServer

Search400

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury

SearchDataCenter

SearchContentManagement

Close