Search code examples
lotus-noteslotus-dominolotusscriptlotus-formula

Copy a table from inside a rich text field into an email in IBM Domino Designer


I have a rich text field on a form with a table in and would like to have a button on the form to send an email with the table copied into the body of the email. I have tried using agents within IBM Domino Designer, but it just seems to copy the text across and not the actual format of the table? Any Help would be appreciated.


Solution

  • This is well possible via LotusScript, just make use of the NotesRichTextItem class:

    Dim YourRTItemIncludingTheTable As NotesRichTextItem
    Set YourRTItemIncludingTheTable = doc.GetFirstItem("YourRTItemIncludingTheTableName")
    
    Set memo = db.CreateDocument
    memo.Form = "Memo"
    ...
    Set rtitem = New NotesRichTextItem(memo, "Body") 
    Call rtitem.AppendRTItem(YourRTItemIncludingTheTable)
    

    This will append the content of the RichText item your table is stored in to the end of the memo's body field.