NotesRichtextItem Dynamic Table

I am creating the dynamic table in the Notes Rich Text Item by backend notes document. My RT item can contain more than one table. Each time I gona access the table I get the last table by NotesRichTextNavigator Method “FindLastElement” i.e.

set rtNav = body.createNavigator

call rtNav.FindLastElement(RTELEM_TYPE_TABLE)

the problem is that after moving the position to last table when I try to access the cell of the table it does not gives me the cell of the table on which I had moved the position. It gives me the cell of first table in RT item.

The code for getting the cell is as follows: -

.

.

set rtNav = body.createNavigator

call rtNav.FindLastElement(RTELEM_TYPE_TABLE)

For ind% = 1 To cols Step 1

Call rtNav.FindNthElement(RTELEM_TYPE_TABLECELL,ind%)

Call body.BeginInsert(rtNav)

Call body.AppendText(colLabels(ind%))

Call body.EndInsert

Next.

Please suggest me how can I get the last table’s first cell and prcoeed with it.

Subject: RE: NotesRichtextItem Dynamic Table

Hello,I think that your code will be working, if you replace line:

Call rtNav.FindNthElement(RTELEM_TYPE_TABLECELL,ind%)

by:

Call rtNav.FindNextElement(RTELEM_TYPE_TABLECELL).

Happy New Year :slight_smile:

Piotr

Subject: RE: NotesRichtextItem Dynamic Table

Table cells are counted from the beginning of the rich text field with GetNthElement. It’s a major limitation, but it is the way it is. If you want a better way to navigate, you’ll need to write something using the C API or turn to a third-party product, specifically the Midas Rich Text LSX from Genii Software ( http://www.geniisoft.com ), which offers a completely intuitive method for navigating multiple and nested tables in rich text, but comes at a price. The easiest native alternative to use is DXL, but it is impractical to use for run-time operations against a UI document.

Subject: RE: NotesRichtextItem Dynamic Table

Thanks a lot for your response anyway.