2

Is there any way to set the style of a section in Lotusscript? I would like to mimic the type of section used in reply with history in lotus notes.

Using lotusscript

  1. Set the margin so the section appears at the extreme left.

  2. Set the section style so that it appears as the "table like" section title used in reply with history.

I can see how to set the color, font etc. But I can't see how to set the actual style of the section.

Bruce Stemplewski
  • 1,343
  • 1
  • 23
  • 66

2 Answers2

1

I think the only way you'll be able to accomplish this would be to use DXL. I.e., do a DXL export of a document containing a section in the style that that you want. Write code to generate the same DXL, modified with anything you need to customize (e.g., title), and import it into a new document. Then write code to open this new document, read the rich text item containing the section, and use AppendRTItem to drop it into the document you are working on.

Richard Schwartz
  • 14,463
  • 2
  • 23
  • 41
1

Looking at your profile you already are familiar with Xpages.

If the app is not to complex i would go for Xpages. Since styling is easier then in a trad. notes app. For me that is.

Here is a example of lotusscript which makes section in a memo since i am not sure what kind of app you are making and for what platform, notes, web or both.

On breaking par is a example wich uses mailfile an memo form and places section and text in mail body

Here is the code

   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

For completness here is a tutorial how to call a lotusscript agent from a xpage Tutorial-Introduction-to-XPages-Exercise-20 Hope it helps.

Edit: Just remembered they held a survey about css and html in the notes client.

ruud van reede
  • 395
  • 3
  • 12
  • I am confused. This looks like lotus script to me. What does this have to do with xPages? In the example, there is it setting the 3 part collapsable section type? – Bruce Stemplewski Jul 23 '12 at 12:45