Plz check this code, not showing correct result

FOR R5 WEB CLIENT

PROBLEM----> NOT DISPLAYING DOCUMENTS WHICH CONTAINS THE SEARCH KEY IN ATTACHMENTS.

FOR WEB CLIENT R 5

EXPLANATION>>

ACTULLY I HAVE A FILE UPLORD CONTROL ON THE SAME FORM I HAVE ATTACHED AN EXCEL FILE, THIS FILE ALSO CONTAIN MY SEARCH STRING BUT ONCE I CLICK SEARCH BUTTON IT IS NOT DISPLAYING ME THAT DOCUMENT WHERE I HAVE AN ATTACHMENT ALONG WITH THAT SEARCH STRING,EVEN I M USING FTSEARCH, REST OF THAT DOCUMENT IT IS DISPLAYING.PLZ ADVICE ME.

THANX A LOT…

IF POSSIBLE PLEASE CORRECT THAT CODE.

Sub Initialize

Dim Session As New NotesSession

Dim db As NotesDatabase

Dim collection As NotesDocumentCollection

Dim doc As notesDocument

Dim doc1 As notesDocument

Dim webFilePath As String, URLBaseVue As String

Dim nbDocs As Integer, countDocs As Integer, i As Integer

’ set collection

Set db=Session.currentdatabase

Set doc1= session.DocumentContext

Set collection = db.FTSearch(doc1.get(0),0)

nbDocs = collection.count

’ if collection is not empty

If nbDocs > 0 Then

Set doc = collection.GetFirstDocument

’ Set base/view URL (view = 0 = default view)

webFilePath = ReplaceSubString(db.FilePath, "" , “/”)

URLBaseVue = “http://localhost/” & webFilePath & “/0/”

’ open TABLE tag

Print |

|

’ loop thru collection

For i = 1 To nbDocs

’ Print one line for each document : add ID doc and ?OpenDocument command

Print |

|’ Get next doc

Set doc=collection.getnextdocument(doc)

Next

’ Close TABLE tag

Print |

doc # | & Cstr(i) & |
|

End If

Exit Sub

End Sub

FUNCTION —>

Function ReplaceSubString(fullString As String, oldString As String, newString As String) As String

Dim position As Integer

Dim lenOldString As Integer

lenOldString = Len(oldString)

position = Instr(fullString, oldString)

Do While position > 0 And oldString <> “”

fullString = Left(fullString, position-1) & newString & Mid(fullString, position + lenOldString)

position = Instr(position + Len(newString), fullString, oldString)

Loop

ReplaceSubString = fullString

End Function

Subject: PLZ CHECK THIS CODE, NOT SHOWING CORRECT RESULT

You will need to look at your FT index. See if it is set up to index attachments.

If it is FT indexed for attachments, note that there will be a time delay between the attachment being uploaded and the index being updated to reflect this.

Does it work if you search for an attachment that has been uploaded for a while?

Rob