How to find a text and highlight it

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.

Subject: How to find a text and highlight it

I use a link to find a string in a document, like a hyperlink.When I click the link, the text is returned ‘selected’ i.e. not neccessarily ‘highlighted’, but like when you left click and drag your mouse over a word on a web page.

I used no special code to make it work: it just ‘selects’ the text for you:

Sub Click(Source As Button)

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc = workspace.CurrentDocument

Call uidoc.FindString("Screenshot 2:")

End Sub