Lotusscript : My searchformula is not correct

Hi

I am trying to get my searchformula right to find a collection of documents, but it gives me an empty collection while ti should give at least 5. Here is the code in which I am searching the docs.

Dim DateTime as new NotesDatetime(“12/01/94”)

Dim searchFormula as string

searchFormula = “(Form = ““Appointment”” | Form = ““Memo””) & @Contains(Subject;'” & MailSubject & “')”

Set col = DB.Search(searchFormula, DateTime, 0)

The intention is to get a collection of documents that has a part of a string ( variable MailSubject) in the subject field. It must be because my searchformula is not correct.

Please help me out

Regards

Subject: Lotusscript : My searchformula is not correct

hallo

try this searchFormula:

searchFormula = “(Form = ““Appointment”” | Form = ““Memo””) & @Contains(Subject;”“” & MailSubject & “”“)”

hope these solves your problem

Subject: Try: searchFormula = {(Form = “Appointment” | Form = “Memo”) & @Contains(Subject; “} & MailSubject & {”)}