BeginInsert Notes 8 Crash at this point, but works fine in Notes 7

Hi,

We have this piece of code to replace a [CourseDate] tag with the actual field doc.DateCompleted, which is a multivalue field. It works perfectly in V7 and always have, but since the users have upgraded to V8 (we have 8.5.2), it duplicates the Course Dates when it replaces the tag, however when I debug, it crashes notes at the statement …

Call rtItem.Begininsert(rtnav, False)

Sub replaceTag(rtitem As NotesRichTextItem, strTag As String, replacementTxt As Variant)

Dim rtnav As NotesRichTextNavigator

Dim rtrange As NotesRichTextRange



Set rtnav = rtitem.CreateNavigator

Set rtrange = rtitem.CreateRange

If rtnav.FindFirstString(strTag, RT_FIND_CASEINSENSITIVE) Then

	

	Do

		Call rtrange.Setbegin(rtnav)

		Call rtItem.Begininsert(rtnav, False)

		

		Forall v In replacementTxt

			rtitem.appendText (Cstr(v))

			rtitem.addnewline(1)

		End Forall

		

		Call rtItem.Endinsert()			

	Loop While rtnav.FindNextString(strTag, RT_FIND_CASEINSENSITIVE)		

End If

Call replaceTxtTag (rtitem, strTag, " ")

End Sub

Any ideas?

Tx