<?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 Re: Change of field order of shapefile attribute table in ArcMap 9.2 in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384237#M10174</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Kyung-&lt;BR /&gt;When you say "it didn't work", is your code finishing with no errors, and when you open the table, the field order is unchanged?&lt;BR /&gt;Do you have any errorhandling in your VBA code to catch errors???&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;Public Sub ChangeFieldOrder()&lt;BR /&gt;&lt;BR /&gt;On Error GoTo Errorhandler&lt;BR /&gt;&amp;lt;your code here&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub&amp;nbsp;&amp;nbsp;&amp;nbsp; 'exit before errorhandler&lt;BR /&gt;Errorhandler:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox "An error occurred in ChangeFieldOrder:" &amp;amp; Err.Description, vbCritical, "ChangeFieldOrder"&lt;BR /&gt;End Sub&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I had no error handler, and running the macro after adding pTableWindow.Refresh caused no runtime error message, and there was no change of field order.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, I added an error handler, but the result was still no error message and no change of field order.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I always made sure that there is only one attribute table is open and there be no other table whether opened or not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kyung&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Feb 2011 19:19:13 GMT</pubDate>
    <dc:creator>KyungKim</dc:creator>
    <dc:date>2011-02-17T19:19:13Z</dc:date>
    <item>
      <title>Change of field order of shapefile attribute table in ArcMap 9.2</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384231#M10168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Withe the following macro, I could open an attribute table of pFeatureLayer that was just added but could not change the field order as I intended.&amp;nbsp; Actually, the field order did not change at all.&amp;nbsp; The macro did not show an error message, though.&amp;nbsp; Probably the macro could not access the opened attribute table?&amp;nbsp; Or, what could be wrong in the following VBA macro?&amp;nbsp; Please, can anybody help me out?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kyung&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; ----&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; ----&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; ' Open the attribute table window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pTableWindow As ITableWindow&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pTableWindow = New TableWindow&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pTableWindow.FeatureLayer = pFeatureLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pTableWindow.Application = Application&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTableWindow.TableSelectionAction = esriSelectFeatures&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTableWindow.ShowAliasNamesInColumnHeadings = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTableWindow.Show True&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get the properties for this table window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pTableProperties As ITableProperties&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pEnumTableProperties As IEnumTableProperties&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pTableProperty As ITableProperty&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pTableProperties = pMxDoc.TableProperties&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pEnumTableProperties = pTableProperties.IEnumTableProperties&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pEnumTableProperties.Reset&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pTableProperty = pEnumTableProperties.Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Re-order the fields&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTableProperty.FieldOrder = "OBJECT_ID, UFI, MF, NT, UNI, LAT, LONG"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Freeze the first 4 fields on the left side of the attribute table&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTableProperty.FrozenFields = 4 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pTableControl As ITableControl&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pTableControl = pTableWindow.TableControl&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTableControl.Redraw&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Refresh the active view.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pActiveView.Refresh&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Feb 2011 14:20:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384231#M10168</guid>
      <dc:creator>KyungKim</dc:creator>
      <dc:date>2011-02-04T14:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Change of field order of shapefile attribute table in ArcMap 9.2</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384232#M10169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As nobody commenting on this topic, I may ask a related question that may invoke some idea.&amp;nbsp; The same macro did work previously on the table based on personal geodatabase in ArcMap 9.1.&amp;nbsp; Now when I use the macro on the table based on shapefile in ArcMap 9.2, it does not work.&amp;nbsp; Does that fact ring a bell to you?&amp;nbsp; Did ESRI change ArcObject change some classes and properties and methods without showing them in documentation?&amp;nbsp; What can the problem be?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kyung&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 13:37:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384232#M10169</guid>
      <dc:creator>KyungKim</dc:creator>
      <dc:date>2011-02-14T13:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Change of field order of shapefile attribute table in ArcMap 9.2</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384233#M10170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kyung-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;After&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]pTableProperty.FieldOrder = "OBJECT_ID, UFI, MF, NT, UNI, LAT, LONG" [/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you need to do this...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]pTableWindow.Refresh()&amp;nbsp; 'necessary to show the new FieldOrder [/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, your comma-delimited list has spaces after each comma; mine does not; not sure if that's an issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Good luck!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 16:46:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384233#M10170</guid>
      <dc:creator>JonHall</dc:creator>
      <dc:date>2011-02-17T16:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Change of field order of shapefile attribute table in ArcMap 9.2</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384234#M10171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Kyung-&lt;BR /&gt;After&amp;nbsp; &lt;BR /&gt;[INDENT]pTableProperty.FieldOrder = "OBJECT_ID, UFI, MF, NT, UNI, LAT, LONG" [/INDENT]&lt;BR /&gt;&lt;BR /&gt;you need to do this...&lt;BR /&gt;&lt;BR /&gt;[INDENT]pTableWindow.Refresh()&amp;nbsp; 'necessary to show the new FieldOrder [/INDENT]&lt;BR /&gt;&lt;BR /&gt;Also, your comma-delimited list has spaces after each comma; mine does not; not sure if that's an issue.&lt;BR /&gt;Good luck!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your interest in this problem.&amp;nbsp; As your saying, I added pTableWindow.Refresh but it didn't work.&amp;nbsp; Then, I removed all spaces from the comma-delimited list, but it didn't work either....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you suggest some other things?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kyung&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 18:44:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384234#M10171</guid>
      <dc:creator>KyungKim</dc:creator>
      <dc:date>2011-02-17T18:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Change of field order of shapefile attribute table in ArcMap 9.2</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384235#M10172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kyung-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When you say "it didn't work", is your code finishing with no errors, and when you open the table, the field order is unchanged?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have any errorhandling in your VBA code to catch errors???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Public Sub ChangeFieldOrder()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On Error GoTo Errorhandler&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;your code here&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub&amp;nbsp;&amp;nbsp;&amp;nbsp; 'exit before errorhandler&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Errorhandler:&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; MsgBox "An error occurred in ChangeFieldOrder:" &amp;amp; Err.Description, vbCritical, "ChangeFieldOrder"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 18:55:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384235#M10172</guid>
      <dc:creator>JonHall</dc:creator>
      <dc:date>2011-02-17T18:55:50Z</dc:date>
    </item>
    <item>
      <title>More than one table?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384236#M10173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kyung-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That 'freeze fields' sample only works with ONE table, if you have more than one Table open in ArcMap, you need to step thru he enum of TableProperties until you find the one for the shapefile name you are trying to change, for example "Streets" :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pEnumTableProperties.Reset&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pTableProperty = pEnumTableProperties.Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do While Not pTableProperty Is Nothing&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Test if it is a FeatureLayer or Standalonetable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pLayer = pTableProperty.Layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If Not pLayer Is Nothing Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; If UCase(pLayer.Name) = UCase("Streets") Then Exit Do 'Found the right pTableProperty!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; pStandaloneTable = pTableProperty.StandaloneTable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; If UCase(pStandaloneTable.Name) = UCase("Streets") Then Exit Do 'Found the right pTableProperty!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; pTableProperty = pEnumTableProperties.Next&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Loop&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 19:04:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384236#M10173</guid>
      <dc:creator>JonHall</dc:creator>
      <dc:date>2011-02-17T19:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Change of field order of shapefile attribute table in ArcMap 9.2</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384237#M10174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Kyung-&lt;BR /&gt;When you say "it didn't work", is your code finishing with no errors, and when you open the table, the field order is unchanged?&lt;BR /&gt;Do you have any errorhandling in your VBA code to catch errors???&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;Public Sub ChangeFieldOrder()&lt;BR /&gt;&lt;BR /&gt;On Error GoTo Errorhandler&lt;BR /&gt;&amp;lt;your code here&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub&amp;nbsp;&amp;nbsp;&amp;nbsp; 'exit before errorhandler&lt;BR /&gt;Errorhandler:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox "An error occurred in ChangeFieldOrder:" &amp;amp; Err.Description, vbCritical, "ChangeFieldOrder"&lt;BR /&gt;End Sub&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I had no error handler, and running the macro after adding pTableWindow.Refresh caused no runtime error message, and there was no change of field order.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, I added an error handler, but the result was still no error message and no change of field order.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I always made sure that there is only one attribute table is open and there be no other table whether opened or not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kyung&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 19:19:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384237#M10174</guid>
      <dc:creator>KyungKim</dc:creator>
      <dc:date>2011-02-17T19:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Change of field order of shapefile attribute table in ArcMap 9.2</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384238#M10175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kyung-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know what could be wrong. If you re-post the latest version of your code, maybe something will hit me. I tried this in VBA a couple years ago and gave up, so I share your frustration. Just got it working in ArcGIS 10, .NET, VS2010.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2 more things you could try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. set the .Application property before anything else:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]Set pTableWindow.Application = Application&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pTableWindow.FeatureLayer = pFeatureLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. verify that you have the TableProperty for the correct Featurelayer, check it's FieldOrder before, and again after you reset it:&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;' Re-order the fields&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Debug.Print("TableProperty FeatureLayer: " &amp;amp; pTableProperty.FeatureLayer.Name)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Debug.Print("TableProperty Original FieldOrder: " &amp;amp; pTableProperty.FieldOrder)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pTableProperty.FieldOrder = "OBJECT_ID, UFI, MF, NT, UNI, LAT, LONG"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Debug.Print("TableProperty Revised FieldOrder: " &amp;amp; pTableProperty.FieldOrder)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The newer interfaces, ITableWindow2 and ITableWindow3, take an iLayer instead if iFeatureLayer; I think those were added in 9.3 and 10.0.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 21:21:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384238#M10175</guid>
      <dc:creator>JonHall</dc:creator>
      <dc:date>2011-02-17T21:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Change of field order of shapefile attribute table in ArcMap 9.2</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384239#M10176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Kyung-&lt;BR /&gt;I don't know what could be wrong. If you re-post the latest version of your code, maybe something will hit me. I tried this in VBA a couple years ago and gave up, so I share your frustration. Just got it working in ArcGIS 10, .NET, VS2010.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;2 more things you could try:&lt;BR /&gt;&lt;BR /&gt;1. set the .Application property before anything else:&lt;BR /&gt;[INDENT]Set pTableWindow.Application = Application&lt;BR /&gt;Set pTableWindow.FeatureLayer = pFeatureLayer&lt;BR /&gt;[/INDENT]&lt;BR /&gt;&lt;BR /&gt;2. verify that you have the TableProperty for the correct Featurelayer, check it's FieldOrder before, and again after you reset it:&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;[INDENT]&lt;BR /&gt;' Re-order the fields&lt;BR /&gt;Debug.Print("TableProperty FeatureLayer: " &amp;amp; pTableProperty.FeatureLayer.Name)&lt;BR /&gt;Debug.Print("TableProperty Original FieldOrder: " &amp;amp; pTableProperty.FieldOrder)&lt;BR /&gt;pTableProperty.FieldOrder = "OBJECT_ID, UFI, MF, NT, UNI, LAT, LONG"&lt;BR /&gt;Debug.Print("TableProperty Revised FieldOrder: " &amp;amp; pTableProperty.FieldOrder)&lt;BR /&gt;[/INDENT]&lt;BR /&gt;&lt;BR /&gt;The newer interfaces, ITableWindow2 and ITableWindow3, take an iLayer instead if iFeatureLayer; I think those were added in 9.3 and 10.0.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you, Jon!&amp;nbsp; How can I thank you enough!&amp;nbsp; Your line saved me!&amp;nbsp; The line-- Debug.Print("TableProperty FeatureLayer: " &amp;amp; pTableProperty.FeatureLayer.Name)-- gave me a shapefile name different than what I expected!&amp;nbsp; The shapefile was there on top inside the main data frame together with many other shapefiles, and the macro has been dufifully working on the shapefile, not on the new file that I intended to create on top of them and manipulate its attribute table.&amp;nbsp; I had thought that even with all existing shapefiles, if any of their attribute table is not open, it's like there are no attribute tables to enumerate, and the new shapefile that I create and open up its attribute table with my macro will be the only attribute table to deal with.&amp;nbsp; The truth is, it seems that the macro sees all shapefiles as attribute table to enumerate even though their attribute table is not opened in ArcMap.&amp;nbsp; Another thing that I found was that the macro's view scope is not limited to just one data frame in which I am working.&amp;nbsp; Actually, I tried the macro inside a new data frame where I have no existing shapefile or anything, but your line caught the top shapefile's name in the other data frame!&amp;nbsp; Yes, the cause was found out, and I used the Do Loop you suggested and I could do reordering, freezing of the attribute table!&amp;nbsp; Thank you so much, Jon!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kyung&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Feb 2011 13:39:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-of-field-order-of-shapefile-attribute-table/m-p/384239#M10176</guid>
      <dc:creator>KyungKim</dc:creator>
      <dc:date>2011-02-18T13:39:49Z</dc:date>
    </item>
  </channel>
</rss>

