Hi,
I have not developed a Notes app for a few years and I am very rusty. I am trying to read a file using the "Open for input" and Input #filenum method then pass the string variable to a View.ftsearch. I know that the string has to be wrapped in quotation marks but cannot get it to work. the search always returns 0 docs in the collection. I know the string works when I put a variable wrapped in quotes from the View.ftsearch("text" , 0). I know that it can be done , but I cannot remember how to do it, nor can I find any solutions on line. Thus I throw myself on the mercy of you guys.
Please ignore the other stuff, this is a "scratch" file to allow me to fiddle with the code
Sub Initialize
Dim sess As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim item As NotesItem
Dim txt As String
Dim nam , blam As String
Dim x As Long
Dim z As integer
Set db = sess.Getdatabase("Tosca", "Names.nsf", False )
Set view = db.getview("($People)" )
Open "c:\temp\glid.txt" For input As 1
Open "C:\temp\faust.txt" For Output As 2
Input #1 , txt
x = view.FTSearch( txt , 0 )
Set doc = view.getfirstdocument()
While Not doc Is Nothing
Set item = doc.getfirstitem("Fullname")
blam = item.contains( txt )
nam = item.text
If blam = False Then Write #2, nam, txt
Set doc = view.getnextdocument(doc)
Wend
Close #1 , #2
End sub
Thanks for the help.
I have not developed a Notes app for a few years and I am very rusty. I am trying to read a file using the "Open for input" and Input #filenum method then pass the string variable to a View.ftsearch. I know that the string has to be wrapped in quotation marks but cannot get it to work. the search always returns 0 docs in the collection. I know the string works when I put a variable wrapped in quotes from the View.ftsearch("text" , 0). I know that it can be done , but I cannot remember how to do it, nor can I find any solutions on line. Thus I throw myself on the mercy of you guys.
Please ignore the other stuff, this is a "scratch" file to allow me to fiddle with the code
Sub Initialize
Dim sess As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim item As NotesItem
Dim txt As String
Dim nam , blam As String
Dim x As Long
Dim z As integer
Set db = sess.Getdatabase("Tosca", "Names.nsf", False )
Set view = db.getview("($People)" )
Open "c:\temp\glid.txt" For input As 1
Open "C:\temp\faust.txt" For Output As 2
Input #1 , txt
x = view.FTSearch( txt , 0 )
Set doc = view.getfirstdocument()
While Not doc Is Nothing
Set item = doc.getfirstitem("Fullname")
blam = item.contains( txt )
nam = item.text
If blam = False Then Write #2, nam, txt
Set doc = view.getnextdocument(doc)
Wend
Close #1 , #2
End sub
Thanks for the help.