Q

Use LotusScript to open all unprocessed docs

I wish to use Lotus Script to instruct it to open all unprocessed documents and save it again with the help of agents. How do I go about doing that?
The unprocessed documents collection will vary depending on the context in which you run your agent. However, the basic process is fairly simple. If you are only going to process one field, check out the stampall method of the NotesDocument class, it's much faster than changing the field and calling save yourself. The following sample LotusScript code should get you going, it could be used to process the selected documents in a view.

Dim nsCurrent As New NotesSession
Dim ndbCurrent As NotesDatabase
Dim ndcCurrent As NotesDocumentCollection
Dim ndocCurrent As NotesDocument
Set ndbCurrent=nsCurrent.currentDatabase
Set ndcCurrent=ndbCurrent.unprocessedDocuments
Set ndocCurrent=ndcCurrent.getFirstDocument
While Not ndocCurrent Is Nothing
'Process document here
Call ndocCurrent.save(True,False)
Set ndocCurrent=ndcCurrent.getNextDocument(ndocCurrent)
Wend
This was first published in April 2002

Dig deeper on Domino Resources - Part 6

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.uk

Close