I want to search and replace characters from rich text field. I may also want to loop thru all the characters and replace them. My code is not doing what i want.Dim session As NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim body As NotesRichTextItem
Dim rtnav As NotesRichTextNavigator
Dim rtrange As NotesRichTextRange
Set session = New NotesSession
Set db = session.CurrentDatabase
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
Set body = doc.GetFirstItem(“Body”)
Set rtnav = body.CreateNavigator
searchString$ = |Body = | & “&” & “”“”
'Set collection = db.Search(searchString$, dateTime,0)
'searchString$ = Inputbox$(“Enter the search string like &, ®, <, >”, “Search string”)
If searchString$ = “” Then Exit Sub
'replaceString$ = Inputbox(“Enter the replacement string. Example & - Ampersand, ® - Register, < - less than, - greater than”, “Replacement string”)
replaceString$=|Body = | & “&” & “”“”
If replaceString$ = “” Then Exit Sub
Call rtnav.FindFirstElement(RTELEM_TYPE_TEXTPARAGRAPH)
Set rtrange = body.CreateRange
count& = rtrange.FindAndReplace(searchString$, replaceString$, RT_REPL_ALL + RT_FIND_CASEINSENSITIVE)
Call body.Compact
Call doc.Save(True, False)
Please advise
amp