Hi All, I am searching for a text value in a document.I am using a dialog box to search for a string value in the document.I am using an InStr function.I am able to find the search value but the how to do i highlight the search string,i need the functionality similar to the google search,after search it should highlight the search value in a different font or should highlight the result string.
I have attached the code to search the String
On Error Goto errorpara
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = ws.CurrentDocument
Dim doc As NotesDocument
Set doc = uidoc.Document
ss = ws.Prompt(PROMPT_OKCANCELEDIT,"Trial","Enter Search Query")
If Isempty(ss)=True Then
Exit Sub
End If
Msgbox Cstr(ss)
fldlist = doc.GetItemValue("docfields")
Msgbox Join(fldlist)
For countVar = 1 To Ubound(doc.docfields)
currentfield = fldlist(countVar)
'Msgbox currentfield,,Cstr(countVar)
pos = Instr ( doc.GetItemValue(currentfield)(0) ,Cstr(ss) )
If Not pos = 0 Then
Msgbox "String Found in " & currentfield,,"String Value Found"
End If
Next
Exit Sub
errorpara:
Msgbox Err() & ": " & Error()&" at line "&Erl,, "Error Occurred"
Exit Sub
The code is executed on a Action Button.
How do i highlight the searched string can any one help me in this regard.