Hi,I have agent to run on all documents in view,but it is picking up only few doc. For example i have 100 documents when i run this agent it should select 100 documents and complete the task but it is selecting 20 docs in first run then 10 docs in second run like this. Could you please help what would be the problem in my code below.
Note: i have tried all the options(all docs in db, all new & modi docs etc) in agent trigger but still same problem.
Sub Initialize
Dim s As NotesSession
Dim db As NotesDatabase
Set s = New NotesSession
Set db=s.CurrentDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim uname As Variant
vname = Inputbox(“enter view name”)
Set view = db.GetView( vname )
Set doc = view.GetFirstDocument
Dim BigString As String, LittleString As String
Dim nam As NotesName
While Not ( doc Is Nothing )
Set nam = s.CreateName(doc.from(0))
LittleString =nam.Abbreviated
bigstring = doc.subject(0)
If Instr(doc.subject(0),LittleString) Then
'Msgbox " found"
Call doc.PutInFolder(“UN Match”)
Call Doc.RemoveFromFolder(“Folder1”)
'Set doc = view.GetNextDocument(doc)
'End If
Else
'If Not Instr(doc.subject(0), LittleString) Then
'Msgbox “Not Found”
Call doc.PutInFolder(“UN Not Match”)
Call Doc.RemoveFromFolder(“folder1”)
'Set doc = view.GetNextDocument(doc)
End If
Set doc = view.GetNextDocument(doc)
Wend
End Sub