Formula to make section

hi everyone,I’m wondering if it is possible to compose a mail with a function formula and a part of it will be a section? I know how to compose the mail but not how to create the section.

The CreateSection command only covers selected text. Maybe there is a way to autoselect a specific range of the text?

Thank you for your help,

Elliott

Subject: maybe this?

take a look at @Command([ComposeWithReference]). Not sure if you can achieve what you want but it has some switches for sections.

Subject: multiple sections

Hi Paul, Thank you very much for your suggestion unfortunately I believe those can only be used to reference an existing document and I think it would give you at most one section. I need to compile a report where each entry consists of a date, a brief summary and then a section (collapsed by default) of the detailed summary.

Please let me know if there is anything anyone else can think of.

Thanks for all your help,

Elliott

Subject: OK, try this

take a look at BeginSection method of NotesRichTextItem. There is an example in there which shows you how to do what you want, not exactly. I did some testing and was able to achieve what you want, creating multiple collapsed sections in a RichText Body field of a document.

Dim ns As New NotesSession

Dim db As NotesDatabase

Set db = ns.CurrentDatabase

Dim doc As NotesDocument

Set doc = ns.DocumentContext

Dim rti As NotesRichTextItem

Set rti = doc.GetfirstItem("Body")

Dim rtstyle As NotesRichTextStyle

Set rtstyle = ns.CreateRichTextStyle

rtstyle.Bold = True

Dim colorObject As NotesColorObject

Set colorObject = ns.CreateColorObject

colorObject.NotesColor = COLOR_RED

Call rti.BeginSection("section 1", rtstyle, colorObject, False)

Call rti.AppendText("help me")

Call rti.EndSection

Call rti.AddNewline(2)

Call rti.BeginSection("section 2", rtstyle, colorObject, False)

Call rti.AppendText("help me")

Call rti.EndSection

Call rti.AddNewline(2)

Call rti.BeginSection("section 3", rtstyle, colorObject, False)

Call rti.AppendText("help me")

Call rti.EndSection

Call doc.Save(True, True)

Exit Sub