Count number of Selected documents in a view

Hi,

I am new to lotus script and well, am stuck with a problem!

I need to write a script (triggered from a view action), that counts the total number of selected documents in a view. (Document selection is done manually). It should then display a messagebox with the total count.

I understand i need to use the NotesDatabase property:UnprocessedDocuments and this is how far i got.

Sub Click(Source As Button)

Dim session As New NotesSession

Dim db As NotesDatabase

Dim collection As NotesDocumentCollection

Dim doc As NotesDocument

Dim doccount  As Integer

doccount = 0

Set db = session.CurrentDatabase

Set collection = db.UnprocessedDocuments

If (Not collection Is Nothing) Then

	For i = 1 To collection.Count

	Next

End If

End Sub

And beyond this I am totally lost.Any help would be greatly appreciated.

Subject: Count number of Selected documents in a view

if u just want to display a message saying this many documents selected,then use message box functionmsgbox “Documents selected are:”+cstr(collection.count)

Subject: count view

Hi This code will display a message ,how many documents are selected

Sub Click(Source As Button)

Dim s As NotesSession

Dim db As NotesDatabase

Dim dc As NotesDocumentCollection

Dim count As Integer

Set s = New NotesSession

Set db = s.CurrentDatabase

Set dc = db.UnprocessedDocuments

count = dc.Count

Msgbox count

End Sub

Subject: Count number of Selected documents in a view

You have the collection, and you’re using the count property, just message box that:

set collection = db.unprocesseddocument

msgbox collection.count