Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

i have annotations stored in mxd document, when i select some annotation , i tried to get the selection through graphics selection, so i got always the rectangle of the dataframe (because i'm working on a axPageLayoutControl), and when i use features 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

1 Answer 1

up vote 1 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.