1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| Sub Initialize
Dim session As New NotesSession
Dim mailDb As New NotesDatabase("", "")
Dim ws As New NotesUIWorkspace
Dim doc As NotesDocument
Dim body As NotesRichTextItem
Dim style As NotesRichTextStyle
Dim color As NotesColorObject
Call mailDb.OpenMail
Set doc = mailDb.CreateDocument
Call doc.ReplaceItemValue("Form", "Memo")
Set body = doc.CreateRichTextItem("Body")
Set style = session.CreateRichTextStyle
Set color = session.CreateColorObject
Call body.AppendText("This is some text before the section")
Call body.AddNewline(2)
Call body.BeginSection("Expanded Section", style, color, True)
Call body.AppendText("Here is some text within the section")
Call body.AddNewline(2)
Call body.AppendText("Here is some more text within the section")
Call body.EndSection
Call body.AddNewline(2)
Call body.AppendText("This is some text between the two sections")
Call body.AddNewline(2)
Call body.BeginSection("Collapsed Section")
Call body.AppendText("Here is some text within the section")
Call body.AddNewline(2)
Call body.AppendText("Here is some more text within the section")
Call body.EndSection
Call body.AddNewline(2)
Call body.AppendText("This is some text after the section")
Call doc.Save(True, False, False)
Call ws.EditDocument(True, doc)
Call doc.Remove(True)
End Sub |