Modifying a Document Action to a View Action

Hello all,I have a current working application that has some action buttons that change the status of the document amongst other workflow type actions.

I want to modify this action so it can act on multiple selected documents at once.

I believe that I would have to loop through the selected docs in the view, but I really do not have any idea how to do this.

There is a Library that contains the calls and that Libary is referenced in the view. With that said, can someone please suggest a modification that would allow me to select one or more docs, click the Complete Action button and have it do the same things as though it were in the document itself.

Here is the code that works on a single doc:

Sub Click(Source As Button)

    Dim w As New NotesUIWorkspace     

    Dim uidoc As NotesUIDocument     

    Dim doc As NotesDocument         

    Dim continue As Integer 

    Set uidoc = w.CurrentDocument         

    Set doc = uidoc.Document 

    

    If ( uiDoc.EditMode = True ) Then 

            Call uidoc.Save() 

    End If 

    Call ChangeStatus ( "Complete", "CompletedBy", "CompletedDate" ) 

    Call SendNotice ( "NotifyMsg5", doc ) 

    uidoc.Close                 

End Sub

Hopefully, this is not a can of worms. I have limited resources and would really appreciate a solution.

Thanks in advance!

Doug Niman

Subject: Use UnprocessedDocuments property

Hi, Doug. I am assuming from your description of the problem and looking at the code that the action buttons now are form action buttons and you want to make the buttons view action buttons. If this is the case, then you will take out the code to get a handle to the uidoc and save it if in edit mode. Just use the UnprocessedDocuments property to create a collection of the selected documents in the view where the action button exists. Use the Lotus Domino Designer Help UnprocessedDocuments property help document to get an examples of this. You can then cycle through each document in the collection and call your subroutines.