Very well.
I shouldn't sort the data source file (this is the eseast way), because the next release saves the created serial letters into datasource (optionaly). Thus I have to sort the document collection.
I have a code to sort the collection useing the document position of a view. But the performance is the central issue.
While I'm writing this, I've got an idea….
I will try to save the document univeral ID in a column to indicate the documents in a sorted worksheet.
Than sort the worksheet befor saving the data source file - it is faster than run through the document collection:
Const xlAscending = 1<br/>
Const xlGuess = 0<br/>
Const xlSortTextAsNumbers = 1<br/>
Const xlTopToBottom = 1<br/>
Call sheet.Range(columns, row).Sort(sheet.Range(columns, row).Cells(1), _ ' Key1<br/>
xlAscending, _ ' Order1 = xlAscending<br/>
sheet.Range(columns, row).Cells(2), _ ' Key2<br/>
, _ ' Type<br/>
xlAscending, _ ' Order2 = xlAscending<br/>
sheet.Range(columns, row).Cells(3), _ ' Key3<br/>
xlAscending, _ ' Order3 = xlAscending<br/>
xlGuess, _ ' Header = xlNo<br/>
1, _ ' OrderCustom<br/>
False, _ ' MatchCase<br/>
xlTopToBottom, _ ' Orientation = xSortRows<br/>
, _ ' SortMethod = xlPinYin<br/>
xlSortTextAsNumbers) ' DataOption1 = xlSortNormal<br/>
And finaly I use the position of the record set in the data source to get the correct letter in the Documents-Object of the word instance.
I think that's easier.