This content has been marked as final.
Show 2 replies
-
1. Re: Loop on all items in a collection
Dan-BTP Oct 4, 2013 2:36 PM (in response to Dan-BTP)Through a lot of trial and error, I discovered the answer to my own question: Collections are base 1, not base 0. My statement
For I = 0 To .MasterSpreads.Count - 1
should be
For I = 1 To .MasterSpreads.Count
-
2. Re: Loop on all items in a collection
mrslother Oct 15, 2013 1:28 PM (in response to Dan-BTP)You are correct that VB uses 1 based indexing whereas Javascript uses 0 based indexing.
I find it easier to use a for each loop (in Javascript):
var myMasterSpread;
fore each ( myMasterSpread in myDoc.masterSpreads )
{
// ... code goes here using the myMasterSpread var
}

