Remove all seleted docs from Inbox folder

Remove all seleted docs from Inbox folder and stamp flag field
LotusScript


Sub Click(Source As Button)
	
	Dim session As New NotesSession
	Dim workspace As New NotesUIWorkspace
	Dim db As NotesDatabase
	Set db=session.CurrentDatabase
	
	Dim selectioncollect As NotesDocumentCollection
	Set selectioncollect = db.UnprocessedDocuments
	
	If selectioncollect.count = 0 Then 
		Msgbox "You have not selected any documents.", 0 + 16
		Exit Sub
	End If
	
	Dim doc As NotesDocument
	Set doc = selectioncollect.GetFirstDocument
	
	Dim count As Long
	
	Do
		Call doc.RemoveFromFolder( "($Inbox)" )
		doc.RemovedFromInbox = "Yes"
		Call doc.Save(True, True)
		Set doc = selectioncollect.getnextdocument(doc)
		count = count + 1 
		Print count & " of " & selectioncollect.count & " documents have been processed"
	Loop Until doc Is Nothing
	
	Print "Done"
	Msgbox "Done!"
	
End Sub

Posted by fbrefere001 on Friday March 8, 2002