HiI have developed a mail merging routine, where i make a NotesDocument with some merge fields, and the i replace them with corresponding values from the databases.
I have run into an issue with line breaks, when i replace the merge fields. I use chr$(13) + chr$(10) as line breaks.
I have debugged my code and it seems its this piece of code that removes the line breaks:
(mergeFields and entry are some utility classes we are using that wraps a simple array, so this function essentially just loops all my translated mergefield values)
Public Sub richTextLib_insertMergeFields_richText(rtitem As NotesRichTextItem)
' Now the translated mergefields will be inserted into the RichTextItem
Dim rtrange As NotesRichTextRange
Dim entry As ccEntry
Dim searchStr As String, replaceStr As String
Set rtrange = rtitem.createRange
Set entry = mergeFields.getFirstEntry
Do While Not entry Is Nothing
searchStr = "[" + entry.getValue("mergefield") + "]"
replaceStr = entry.getValue("translated")
rtrange.findAndReplace searchStr, replaceStr, RT_FIND_CASEINSENSITIVE + RT_REPL_ALL + RT_REPL_PRESERVECASE
Set entry = mergeFields.getNextEntry
Loop
End Sub
As far as i can tell the line breaks dissapears when i use the rtrange.findAndReplace method.
Is there some workaround or solutions for this?
Kind regards
Jacob