<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to get the field name labeled in a layer? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-the-field-name-labeled-in-a-layer/m-p/343510#M9037</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everybody! Thanks for read my message. I want to get the field name that is labeled in a layer but I can not do this. Also, I want to get the color, font and size of the symbol that the label have. Can somebody help me please??? I really will appreciate your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Apr 2011 16:49:19 GMT</pubDate>
    <dc:creator>ViridianaGO</dc:creator>
    <dc:date>2011-04-26T16:49:19Z</dc:date>
    <item>
      <title>How to get the field name labeled in a layer?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-the-field-name-labeled-in-a-layer/m-p/343510#M9037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everybody! Thanks for read my message. I want to get the field name that is labeled in a layer but I can not do this. Also, I want to get the color, font and size of the symbol that the label have. Can somebody help me please??? I really will appreciate your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2011 16:49:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-the-field-name-labeled-in-a-layer/m-p/343510#M9037</guid>
      <dc:creator>ViridianaGO</dc:creator>
      <dc:date>2011-04-26T16:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the field name labeled in a layer?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-the-field-name-labeled-in-a-layer/m-p/343511#M9038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi again! I have tried to do this (I do not know if it is correct to get the name field labeled):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
//I get the item in the Collection
IAnnotateLayerPropertiesCollection pAnnoLayerPropsColl = pGeoFLayer.getAnnotationProperties();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
IAnnotateLayerProperties[] alpArray = new IAnnotateLayerProperties[10];
IElementCollection[] visibles = new IElementCollection[10];
IElementCollection[] invisibles = new IElementCollection[10];
pAnnoLayerPropsColl.queryItem(0, alpArray, visibles, invisibles);

//I get the text in the label
IElement[] pElement = new IElement[10];&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
ITextElement pTextElement;
int i = 0;
String sText;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 for (i=0; i &amp;lt; visibles.length; i++){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;visibles[0].queryItem(i, pElement, null);&lt;/STRONG&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTextElement = (ITextElement) pElement[0];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sText = pTextElement.getText();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(sText);
 }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess sText has the name field, but when I run this, this show me the AutomationException:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
AutomationException: 0x80070057 - The hook has not yet been set into the CommandPool in 'esriControls.CommandPool.1'
at com.esri.arcgis.carto.ElementCollection.queryItem(Unknown Source)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in the line: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visibles[0].queryItem(i, pElement, null);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not know what this mean, I really will appreciate your help, Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:11:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-get-the-field-name-labeled-in-a-layer/m-p/343511#M9038</guid>
      <dc:creator>ViridianaGO</dc:creator>
      <dc:date>2021-12-11T16:11:29Z</dc:date>
    </item>
  </channel>
</rss>

