Unread Marks possible to programming

Hi

I have a database with unread marks. I works that it used to but I wan't to do ´this:

When a user opens a document the document is markes read.

Once a week an Agent is run that alter one Authors-field to make it impossible for a user to change documents.

My problem is that when the Agent is run the document is marked unread again, but the users have read them.

Is is possible to solve that, in version 5 (.11) or can I solve it with version 6.
tord_fAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ZvonkoSystems architectCommented:
The functions to enumerate unread docs for a user and switch the unread marks are available only in API.

It is difficult to determine the correct parameters for particular users and it it is not worth the effort.
It is only interesting for playing around with it.

Here the first part of it to fetch all documents unread by actaul user:

Option Public
Option Declare
Declare Function IDEntries Lib "nnotes.dll" (Byval hTable&)As Integer
Declare Sub NSFDbClose Lib "nnotes.dll" (Byval DBHANDLE&)
Declare Sub OSMemFree Lib "nlib.dll" (Byval Handle As Long)
Declare Function OSPathNetConstruct Lib "nlib.dll" ( Byval PortName$, Byval ServerName$, Byval FileName$, Byval retPathName$)As Integer
Declare Function NSFDbOpen Lib "nnotes.dll" ( Byval PathName$, rethDB&)As Integer
Declare Function IDScan Lib "nnotes.dll" (Byval hTable&, Byval fFirst%, DWORD&)As Integer
Declare Function NSFDbGetUnreadNoteTable Lib "nnotes.dll" (Byval DBHANDLE&, Byval UserName$, Byval UserNameLength%, Byval                     fCreateIfNotAvailable%, rethUnreadList&)As Integer
Declare Function NSFDbUpdateUnread Lib "nnotes.dll" (Byval DBHANDLE&,Byval UnreadList&) As Integer

Sub Initialize
   Dim s As New notessession
   Dim Ret#
   Dim UName$
   UName$=s.commonusername
   Ret#=GetUnreadDocs("","log.nsf",UName$)'
   Msgbox "In the LOG.NSF file " & UName$ & " has " & Ret# & " Unread Docs " 
End Sub

Function GetUnreadDocs(Server$,Database$,UserName$)As Long
   Dim DBHND&, id&,ct&
   Dim fFirst%
   Dim retPathName$
   Dim Status%
   Dim Entries&
   Dim hTable&
   retPathName$=Space$(256)
   Status%=OSPathNetConstruct("",Server$,Database$,retPathName$)
   Status%=NSFDbOpen(retPathName$,DBHND&)
   Status%=NSFDbGetUnreadNoteTable(DBHND&,UserName$,Len(UserName$), True, hTable&)
   Status%=NSFDbUpdateUnread(DBHND&,hTable&)
   Entries&=IDEntries(hTable&)
   ct&=0
   ID&=0
   fFirst%=True
   Do While IDScan(hTable&,fFirst%,id&)
      Print "DOC ID " & Hex$(id&) , Cstr(id&)
      'This is where you should be able to use to set a notes document.
      'Set doc = db.GetDocumentByID(Hex$(id&))
      fFirst=False
      ct&=ct&+1
   Loop
   Call OSMemFree(hTable&)
   Call NSFDbClose(DBHND&)
   GetUnreadDocs=ct&
End Function


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tord_fAuthor Commented:
Hi

Thanks for the code.

I vill try and experiment and maybe I have a solution in the future.
0
ZvonkoSystems architectCommented:
Oh, thanks for the points :-)

The upper code is only to read Unread Marks.
The code you asked for I have in my office tips collection.
I am first on Tuesday in office and will look for your code.

So long,
Zvonko

0
tord_fAuthor Commented:
The code function perfekt and read the unread marks. The only thing that is missing is code that marks documents.

I have scan Notes net but I don't find much about APIs. Is APIs for Notes published at the webb?

//Tord
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.