Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have annotations stored in mxd document, when I select some annotation, I tried to get the selection through graphics selection, so I always get the rectangle of the dataframe (because I'm working on a axPageLayoutControl), and when I use feature selection I get nothing; so none of them return the annotation selection.

How could I get the annotation selection in ArcObjects?

I'm using ArcObjects 10.1.

share|improve this question
up vote 2 down vote accepted

Annotations are stored in the Graphicscontainer of BasicGraphicsLayer, so this code get the selection of Annotations, it works for me :)

IGraphicsContainerSelect graContSel = (IGraphicsContainerSelect)mapDocument.ActiveView.FocusMap.BasicGraphicsLayer;

m_enumElem = graContSel.SelectedElements; 


elem = m_enumElem.Next();

ITextElement txel = elem as ITextElement;
share|improve this answer
+1 However, I've found IEnumElement will often not start at the beginning unless I explicitly call Reset(). – Kirk Kuykendall Oct 23 '12 at 13:29
Thanks @KirkKuykendall, answer updated. – geogeek Oct 23 '12 at 16:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.