How to read cell values from a single table inside a richtext field using lotusscript? -


scenario there's form richtext field (let's it's called body); button called read

upon creation of document, richtext field body have default 2x2 table inside of it. user have input values in cells , press read read values table , insert array.

the document has saved in order able read richtext- item- contents.

then notesrichtexttable- class point start with. follwoing example taken designer- (yes, 1 integrated in designer, found here @ ibm...)

dim ws new notesuiworkspace dim uidoc notesuidocument  dim doc notesdocument dim rti notesrichtextitem dim rtnav notesrichtextnavigator dim rtt notesrichtexttable dim rtrange notesrichtextrange  set uidoc = ws.currentdocument call uidoc.save() 'otherwise not able contents of richtextitem  set doc = uidoc.document set rti = doc.getfirstitem("body") set rtnav = rti.createnavigator if not rtnav.findfirstelement(rtelem_type_table)   messagebox "body item not contain table,",, _   "error"   exit sub end if set rtt = rtnav.getelement set rtrange = rti.createrange call rtnav.findfirstelement(rtelem_type_tablecell) firstflag = true i& = 1 rtt.rowcount   j& = 1 rtt.columncount     if not firstflag       call rtnav.findnextelement(rtelem_type_tablecell)     else       firstflag = false     end if     call rtrange.setbegin(rtnav)     messagebox rtrange.textparagraph,, _     "row " & i& & _     ", column " & j&   next next 

Comments