Below code is present on the postopen event of form. It is supposed to load the table of two rows with the headings in the first row. Heading are as mentioned in the code.But this does not create the table.
Also the table should be created only when the document is new…
Any suggestion??
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim rti As NotesRichTextItem
Dim rtnav As NotesRichTextNavigator
Dim rtt As NotesRichTextTable
Dim richStyle As NotesRichTextStyle
Dim sess As New NotesSession
Set uidoc=ws.CurrentDocument
Set doc=uidoc.Document
Set rti=doc.GetFirstItem("MeetingAgenda")
If rti Is Nothing Then
Set rti = doc.CreateRichTextItem("MeetingAgenda")
End If
Set rtnav = rti.CreateNavigator
Set richStyle = sess.CreateRichTextStyle
Call rti.AppendTable( 1, 3)
Call rtnav.FindFirstElement(RTELEM_TYPE_TABLE)
Set rtt = rtnav.GetElement
richStyle.Bold = True
richStyle.FontSize = 9
Call rti.AppendStyle(richStyle)
Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)
Call rti.BeginInsert(rtnav)
Call rti.AppendText("Item #")
Call rti.EndInsert
Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)
Call rti.BeginInsert(rtnav)
Call rti.AppendText("Topic")
Call rti.EndInsert
Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)
Call rti.BeginInsert(rtnav)
Call rti.AppendText("Timing")
Call rti.EndInsert
Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)
richStyle.Bold = False
Call rti.AppendStyle(richStyle)
Call rtt.AddRow(1)
Call uidoc.Save()
Call uidoc.Close()