Hi AllTo All Woman : Happy Woman’s Day
I Have to Run an agent Either After New mail arrived or before new mail arrived in my mail box. The code is working fine when i run it through action menu but it is not working After New mail arrived or before new mail arrived. IM sending my code just go through it :
===============================================
Dim workspace As New NotesUIWorkspace
Dim s As New notessession
Dim db,db1 As notesdatabase
Dim doc,doc1 As notesdocument
Dim vw,vw1 As NotesView
Dim doc2 As NotesDocumentCollection
Set db = s.CurrentDatabase
Set vw1 = db.getview(“($All)”)
Set db1=s.GetDatabase(“v2solutions”,“AttachDo.nsf”)
Set doc=vw1.GetFirstDocument
Set vw = db1.GetView(“v2_ProfileView”)
While Not doc Is Nothing
c=0
Mail_Id=doc.principal(0)
Set doc2 = vw.GetAllDocumentsByKey(Mail_Id)
x = doc2.Count
If x =< 0 Then
Set doc1= doc
Call doc1.remove(True)
Call vw1.Refresh
Call workspace.ViewRefresh
c=1
End If
If c=1 Then
Set doc=vw1.GetFirstDocument
Else
Set doc=vw1.GetNextDocument(doc)
End If
Wend
=============================================
Sanjay Prasad