Table and richtext fields

I write a lot to back end documents but avoid (like the plague) rich text fields.

Now I’m back again trying to do so and I have no idea how to accomplish this…

I have a form…with a richtext field in it already…

I write a agent that creates a new doc based upon the same form, fills out all other fields but when it comes to inserting a table into this pre-existing rt field, i cannot.

All example show me to use “Body” which doesn’t exist…

How can I get a handle on this currently existing RT field and put in a table?

~Salute!

Subject: Help file

The help file for appendtable gives you everything you need. Yes, you need to getfirstitem rather than create a new one. You can get whatever item name you want (doesn’t have to be Body)

%INCLUDE “lsconst.lss”

Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Set db = session.CurrentDatabase

Dim doc As New NotesDocument(db)

Call doc.AppendItemValue(“From”, session.UserName)

Call doc.AppendItemValue _

(“Subject”, Inputbox(“Subject?”))

Dim rti As New NotesRichTextItem(doc, “Body”)

Call rti.AppendText(“Paragraph of text”)

Call rti.AddNewLine(2)

Dim rows As Integer, columns As Integer

rows = 4

columns = 3

Dim tabs() As String

If Messagebox(“Do you want a tabbed table?”, _

MB_YESNO + MB_ICONQUESTION, “Tabbed?”) = IDNO Then

Call rti.AppendTable(rows, columns)

Else

Redim tabs(1 To rows)

For i = 1 To rows

  tabs(i) = "Row " & i

Next

Call rti.AppendTable(rows, columns, tabs)

End If

Call doc.Save(True, False)

End Sub

Subject: Thank you

I used that help document for a template.

GetFirstItem… I spaced that…

Thanks!