Manage Learn to apply best practices and optimize your operations.

Searching in a Rich Text Field

Notes by default does not have any in-built/native function or property which can search a Rich Text Field content.

Notes by default does not have any in-built/native function or property which can search a Rich Text Field content. I happenned to face this problem in one of my projects. Please try "GetDesiredContent" function given below. This function searches for the first word containing "*" in Body field of the given document. You may manipulate the given function to meet your requirement.

NOTE: I used array of all items in source document to get "Body" item. This is useful when notes is having multiple "Body" fields e.g. in mail document.

Function GetDesiredContent(sourceDoc As NotesDocument) 

'Get Body field from list of fields 
     Forall x In sourceDoc.items 
          If x.Name="Body" Then 
               Set bodyItem=x 
               Exit Forall 
          End If 
     End Forall 

'Get handle to Body field 


'Search for first occurrance of '*' 

If pos>0 Then 
          pos1=Instr(pos,bodyContent," ") 

'Start trimming to extract "*" containing word 
          Do While True 
               pos1=Instr(tempString," ") 
               If pos1=0 Then 
                    Exit Do 
               End If 
     End If 

'Convert resultant content to text 

'If formatted content contains blank spaces then reprocess it 
     If Instr(formattedText(0)," ")>0 Then 
          Goto formatContent 
     End If 

'Return the final formatted content containing "*" 

End Function

Dig Deeper on Domino Resources - Part 7

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.



  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...