I have a lotusscript program that creates a rich text table in an email. This works fine. Once the table is populated with data, I want to print some text below the table. This added text appears as if it is in a cell of a table without borders. My code in the last cell of the table is:
Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)
Call rtitem.BeginInsert(rtnav)
Call rtitem.Append Text(“Some Text”)
Call rtitem.EndInsert(rtnav)
Subject: Notes Rich Text Table
If I understand you correctly, you just want some text to appear below the table, after populating it? Then your code should look something like this after the last actual insert into the table:
.
.
.
Call rtitem.EndInsert(rtnav) 'last insert
Call rtitem.AddNewLine(2) 'or however many lines you want
Call rtItem.AppendText(“Some Text”)
Hope that helps.
Subject: RE: Notes Rich Text Table
Thanks. I had already tried that and the problem is the text comes out like this as if it is still in a column:
Some
Text
Subject: RE: Notes Rich Text Table
You probably need to create a new paragraph style and append it first. It sounds like it is holding on to the paragraph definition from the table cell, which has right and left borders and would look like a column.
Subject: RE: Notes Rich Text Table
Thanks. I tried it and got the same results. The text is right-justified like the previous table cell and in a column.
Subject: RE: Notes Rich Text Table
When you set the NotesRichTextParagraphStyle.Alignment = ALIGN_LEFT it still didn’t change?
Subject: RE: Notes Rich Text Table
Even after specifying the alignment change, it didn’t change.
Call rtitem.EndInsert
titlestyle.Alignment=ALIGN_LEFT
Call rtitem.AppendParagraphStyle(titlestyle)
Call rtitem.AddNewLine(2)
Call rtitem.AppendText(“some text that is a little longer than the fraudulent table cell so that it incorrectly wraps”)
Subject: RE: Notes Rich Text Table
Scary, isn’t it. Well, it is probably overkill for what you want, but our Midas Rich Text LSX would handle this easily, and if it ever exhibited a bug like this, we would fix it. I can’t understand why the Notes Rich Text classes are still as buggy as they are (although I am biased since we compete with them).
Subject: Notes Rich Text Table
I’ve been incorporating the exact same functionality and had the same problem. I tried many different combinations and finally found one that worked.
After I populate the last cell in my table, I was able to add text below it with the following lines:
Call rtnav.SetPositionAtEnd(rttable)
Call rtitem.BeginInsert(rtnav, True)
Call rtitem.EndInsert
“rttable” refers to the actual table element defined in the RichTextNavigator class.
And the True parameter in the BeginInsert method puts the insertion position at the end of the element (in this case, the table.)
Hope this helps!
Thanks