Public Sub go() Dim pfc As IFeatureClass Dim pmap As IMap Dim pdoc As IMxDocument Set pdoc = ThisDocument Set pmap = pdoc.FocusMap Dim pflayer As IFeatureLayer Set pflayer = pmap.Layer(0) Set pfc = pflayer.FeatureClass Dim i As Integer Dim layername As String 'this is what I want to rename the field to layername = "MyNewName" Dim pfield As IField Dim pfieldedit As IFieldEdit2 Dim lfld As Integer 'this is the original field name lfld = pfc.FindField("NEAR_DIST") Set pfield = pfc.Fields.Field(lfld) Set pfieldedit = pfield pfieldedit.Name = layername End Sub
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.