Appending inside sections not working

Hello,

Using the new NotesRichTextNavigator class, get a bit of text inserted into a section.

Problem is that text gets inserted outside the section, almost as if the methods like FindFirstElement are not positioning the insertion point correctly.

Any help appreciated.

code snippet:

    Set uidoc = workspace.CurrentDocument 

    Set doc = uidoc.Document 

    Set rti = doc.GetFirstItem("Body") 

    Set rtnav = rti.CreateNavigator 

    

    If rtnav.FindFirstElement(RTELEM_TYPE_SECTION) Then 

            Messagebox "Found Section in Body",, "Section" 

            

            Call rti.AddNewLine(1) 

            Call rti.AppendText("Appended Text after Find") 

            Call doc.Save(True, True) 

            

            Set rts = rtnav.GetElement 

            rts.IsExpanded = True 

            

            Call rti.AddNewLine(1) 

            Call rti.AppendText("Appended Text after expand") 

            Call doc.Save(True, True) 

’ This part fails “Element or Navigator is invalid”

’ Call rtnav.SetPosition(rts)

’ Call rti.AddNewLine(1)

’ Call rti.AppendText(“Appended Text after SetPosition”)

’ Call doc.Save(True, True)

’ However, rts seems fine for this call

            Call rtnav.SetPositionAtEnd(rts) 

            Call rti.AddNewLine(1) 

            Call rti.AppendText("Appended Text after SetPositionAtEnd") 

            Call doc.Save(True, True) 

            

    Else 

            'nothin 

            

    End If

Subject: Appending inside sections not working

You are correct; FindFirst… and other methods of RTNav do not position the insertion point. This is working as designed. You would have to use the NotesRichTextItem.BeginInsert method to do that.

I’m not sure whether a BeginInsert at the position of a section will place the insertion point within the section – it might insert before the section – the help says “at the beginning of the element,” which is a little ambiguous. You might need to search for the section, then search for the next paragraph within the section, or something like that.

Subject: RE: Appending inside sections not working

Hello,

I had tried the begininsert prior to the element methods and it did not put things inside the section.

Maybe in release seven

Subject: You could always use a 3rd party product that has supported this since R4.1

It is unlikely that this issue alone would justify use of a third party product, but if you want to overcome the various problems with ND6 rich text manipulation (e.g., nested tables, insertion in sections, find & replace), and add significant additional functionality (e.g., sorting tables, automatic cross-index links, dynamic layers), our Midas Rich Text LSX has been around and widely used for several major generations of Notes/Domino, and still supports R4.5x through ND6.5x. This particular functionality (inserting inside a section) has been available and working since Midas Version 1.0 was released in July 1997. How many more years/versions are you willing to wait?