IBM Support

Error: 'Illegal column width...' when using AppendTable method of NotesRichTextItem class

Technote (troubleshooting)


When calling the AppendTable method of the LotusScript NotesRichTextItem class in Lotus Domino Designer, the following error message occurs when you try to create a large number of cells, for example 15 X 13:

    "Illegal column width - check Left and Right margins."

The following list contains the known numbers of rows and columns that fail with the error when creating a table with the AppendTable method:

Rows x Columns
    184 x 4
    116 x 5
    79 x 6
    57 x 7
    42 x 8
    34 x 9
    27 x 10
    22 x 11
    18 x 12
    15 x 13
    13 x 14
    11 x 15
    10 x 16
    9 x 17
    8 x 18
    7 x 19
    6 x 20
    6 x 21
    5 x 22
    5 x 23

Resolving the problem

This issue has been reported to Quality Engineering as SPR# TKIE6279G2.

Instead of creating the full table initially, just create it with one row and all of the columns required for the table. Then use the NotesRichTextTable class, AppendRow method, to append the number of rows desired up to 255 rows (the maximum number of rows allowed in a table).

The following code provides an example of how to do this, assuming a variable named "rtEmailBody" that is a NotesRichTextItem:

NOTE: The code below is a sample script, provided to illustrate one way to approach this issue and is used at your own risk. In order for this example to perform as intended, the script must be laid out exactly as indicated below. Product Support cannot customize this script for specific environments or applications.

'Insert the table with only

    Call rtEmailBody.AppendTable(1, columns)
    ' Call rtEmailBody.AppendTable(rows, columns)

    'Get the table
    Dim rtnav As NotesRichTextNavigator
    Set rtnav = rtEmailBody.CreateNavigator
    If Not rtnav.FindFirstElement(RTELEM_TYPE_TABLE) Then
      Messagebox "Could not find table",, "Fatal error"
        Exit Sub
      End If
    Dim rtt As NotesRichTextTable
    Set rtt = rtnav.GetElement
    Dim inputRows As Integer
    inputRows = Cint(Inputbox$("How many rows do you want?"))

Document information

More support for: IBM Domino Designer

Software version: 6.0, 6.5, 7.0, 8.0, 8.5

Operating system(s): Windows

Reference #: 1260833

Modified date: 06 May 2011

Translate this page: