Search code examples
lotus-dominolotusscriptagent

lotus notes/ibm notes/domino 9 - how make emails read/unread programmatically in lotus script?


I have traversed documents in the .nsf database in various ways (as a list of documents in database and/or list of documents in a view) but cannot find where read/unread email mark is stored. Due some large volume message processing I would need to examine each message and determine if read mark is set and according to algorithm mark it as read or not. (read some posts on internet but they apply to v6 - unsure if the same mechanism still applies to v9)

At this stage there is no exact code to show, as I am looking for ideas and suggestions how to do the agent code.

If it cannot be done from Lotus Script (as agent), please advise other better way, as I need to process multiple databases.


Solution

  • To access the flag:

    flag = notesDocument.GetRead([username] ) Returns true if the current document has been read, otherwise false. Note This method is new with Release 8.5.

    To update it:

    Call notesDocumentCollection.MarkAllUnread( [username] )

    Call notesViewEntryCollection.MarkAllRead( [username] )

    For more fancy usage it could be with C API (never tested!) have a look at http://www-12.lotus.com/ldd/doc/tools/c/5.0.3/api503re.nsf/70cfe734675fd140852561ce00718042/d223db362ddb9e9985256632004f71db?OpenDocument