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