Hi,
I took this example from Lotus Domino Designer 7 Help to get a rowcount of a table in a “Body” richtext field of “Memo” mail database. It works on detecting the existence of a table but the rowcount for that table is not working. If I edit and save that mail then the rowcount works.
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim dc As NotesDocumentCollection
Set dc = db.UnprocessedDocuments
Dim doc As NotesDocument
Set doc = dc.GetFirstDocument
totalrow = 0
Dim rti As NotesRichTextItem
Set rti = doc.GetFirstItem("Body")
Dim rtnav As NotesRichTextNavigator
Set rtnav = rti.CreateNavigator
If Not rtnav.FindFirstElement(RTELEM_TYPE_TABLE) Then
Messagebox "Body item does not contain a table",, "Error"
Exit Sub
End If
Dim rtt As NotesRichTextTable
Call doc.Save(True,True)
Set rtt = rtnav.GetElement
Dim rowcount As Integer
rowcount = 0
rowcount = rtt.RowCount
Msgbox rowcount,,"Rowcount"
End Sub
What do I need to do to"refresh" this backend doc so the rowcount for the table can be seen?
Many thanks in advance for your help or suggestions.