Export pre-sorted document prior to export

I have setup an agent to export data from a view to a new document with column and rows, which then gets merged into a Word lable template. The problem I’m having is when the data gets exported it isn’t in any sort order. I would like to sort by the lastName field.

Is there a function in lotus Script that allows you to sort the collection?

Thanks in advanced.

Subject: Export pre-sorted document prior to export

You have to load your NotesDocumentCollection into an array and then use a function to sort the array.

Subject: Export pre-sorted document prior to export

Thanks for the info. I have never worked with an Array, but I guess it’s time I learned.