LotusScript to C API Programming Guide

rtLib Domino Rich Text Management template
Home
Show details for ContentContent
Purchase
Ready-to-use samples
Show details for Online resourcesOnline resources
Forum
Links
Happy readers

Anonymous

login


 

Hosted by Prominic.NET, Inc.
Main topic: Refreshing view to show toggled subset of docs as now being marked as read

Refreshing view to show toggled subset of docs as now being marked as read (by Declan Moore, 01/17/2005 11:32:57 AM)

Hi Normunds

I have the following code in the PostOpen event of a database, with which I want to force certain documents to appear in black (irrespective of whether they have been previously accessed or not) in a defaults view (i.e. InBox):

Set urm = New NotesUnreadMarks(db,sess.UserName)

Call urm.MarkDocumentRead( urm_Next_Doc )

The following is an excerpt of the ScriptLibrary containing the API calls (the usual declarations omitted):

Class NotesUnReadMarks

......

......

Sub MarkDocumentRead(inpNotesDocument As NotesDocument)

Dim NoteID As Long

NoteID = DocList(inpNotesDocument.NoteID).NoteID

If NoteID = 0 Then

Exit Sub

End If

      

'Copy the table so that changes can be merge to the original

Me.rc = W32_IDTableCopy(Me.hUnreadTable, Me.hOriginalTable)

If Me.rc <> 0 Then

Error 14006, "NotesUnreadMarks: Unable to copy unread table."

End

End If

      

'Refresh the Unread table

Me.rc = W32_NSFDbUpdateUnread(Me.hDb, Me.hUnreadTable)

If Me.rc <> 0 Then

Error 14004, "NotesUnreadMarks: Error refreshing the unread note table."

End

End If

If W32_IDIsPresent (Me.hUnReadTable, NoteID) Then

Me.rc = W32_IDDelete (Me.hUnReadTable, NoteID, &h0)

If Me.rc = 0 Then

Me.rc = W32_NSFDbSetUnreadNoteTable(Me.hDb, Me.sPrvUserName, Len(Me.sPrvUsername), True, Me.hOriginalTable, Me.hUnreadTable)

If Me.rc = 0 Then

If DocList(inpNotesDocument.NoteID).NoteID = lPrvLastNoteID Then

lPrvLastNoteID = DocList(inpNotesDocument.NoteID).PrevNoteID

End If

If DocList(inpNotesDocument.NoteID).NoteID = lPrvFirstNoteID Then

lPrvFirstNoteID = DocList(inpNotesDocument.NoteID).NextNoteID

DocList(lPrvFirstNoteID).PrevNoteID = 0

End If

Erase DocList(inpNotesDocument.NoteID)

End If

End If

End If

If Me.hOriginalTable <> 0 Then

Call W32_IDDestroyTable(hOriginalTable)

End If

End Sub

.....

.....

End Class

The code partially works, in that the docs are changed to being highlighted in black when the DB is opened, but only after I manually refresh the view (i.e. F9 etc). The command Call View.Refresh does not appear to resolve my issue either. Any suggestions on how I can refesh the view to reflect the documents changes???

Cheers in advance