C#/Domino COM: Problems reading RTF tables

Discussion in 'Lotus Notes Programming' started by Primoz Kosir, Jun 26, 2017.

  1. Primoz Kosir

    Primoz Kosir New Member

    Jun 26, 2017
    Likes Received:
    I'm developing a document parsing application in C# (Visual Studio 2015) using the Domino v1.2 COM library for server (IBM Lotus Notes/Domino 9.0.1)

    I'm having issues with extracting the tables in a rich text TXDocReason item - here's what I'm doing:

    - extract a document from a database
    - extract TXDocReason item into a NotesRichTextItem
    - create a NotesRichTextNavigator using the rich text item above
    - Use NotesRichTextNavigator.FindFirstElement and NotesRichTextNavigator.FindNextElement to look for RTELEM_TYPE_TABLE elements
    - Check if any table elements found to NotesRichTextTable objects (The table exists for sure!!!)

    I'm encountering a problems that the code below don't return any table inside TXDocReason.

    //------initialization code----
    NotesDocument doc = docView.GetFirstDocument();
    Array itemArray = (System.Array)doc.Items;
    for (int i= 0; i< i.Length; i++)
    NotesItem notesItem = (NotesItem)itemArray.GetValue(i);
    if (name != "TXDocReason") continue;
    NotesRichTextItem richTextItem = (NotesRichTextItem)notesItem;
    NotesRichTextNavigator rtnav = richTextItem.CreateNavigator();
    if (rtnav.FindFirstElement(RT_ELEM.RTELEM_TYPE_TABLE))
    //------read table----
    while (rtnav.FindNextElement(RT_ELEM.RTELEM_TYPE_TABLE))
    //------read table----

    I can retrieve all other elements (RTELEM_TYPE_DOCLINK, RTELEM_TYPE_FILEATTACHMENT, RTELEM_TYPE_SECTION etc.) except the tables. The count of the tables inside RTF is always zero.

    What I doing wrong? How can I extract a table and its cell?

    Any ideas?

    Regards Primoz
    Primoz Kosir, Jun 26, 2017
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.