How to write a 'zoom to next feature' addin?

Discussion created by cat_nicol on Feb 1, 2012
Latest reply on Feb 1, 2012 by kenbuja
I am trying to write an addin for Arc 10 that will zoom to the next feature in a layer each time I click a button. I have found a VBA sample that does this ( and modified it to work in an addin.  However, this approach has failed as the cursor it uses to loop through the features does not seem to be retained with each button click now that the tool is outside of the ArcMap application - so each time i click the button i get zoomed to the first feature in the table.

Is it the case that if i use a cursor in an add-in it will not be retained when I next click the same button?  If so, what can I do instead of a cursor to maintain my position in the feature table when I next click the button to zoom to next feature?