Looping through categories - efficient method

Hi,

I have the following code to loop through the categories in a view which seems to be running extremely slowly

Set OrgNameView=db.Getview("OrgNamesCat")

Set Nav = OrgNameview.CreateViewNav

Set entryA = nav.GetFirst

While Not entryA Is Nothing

	Category=entryA.ColumnValues(0)

	'

	' ***** Other code to retrieve all docs in category and merge some fields to create new document in another database***** 

	'

	Set entryA=Nav.GetNextCategory(entryA)

Wend

I have not written the other code yet as I am not sure that I am doing this in the most efficient way

Any suggestions/comment?

TIA

Subject: RE: Looping through categories - efficient method

Looks to me like a reasonable way to do it, and I wouldn’t expect it to be slow unless the view itself is unusually slow. This could be caused by e.g. selection formulas or view column formulas that use @Now or @Today, use of Readers fields in conjunction with the “don’t show empty categories” option, odd indexing options, or if there are massive numbers of changes occurring in the documents.