Solved! Go to Solution.
import arcpy import os import glob folder = r"\\sample\sample" oldtext = "Township" newtext = "Borough" mxds = glob.glob(folder + '\\' + '*.mxd') arcpy.gp.overwriteOutput = True for mxdFile in mxds: mxd = arcpy.mapping.MapDocument(mxdFile) for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"): if elm.text == oldtext: elm.text = newtext mxd.save() del mxd
for mxdFile in mxdList: mxd = arcpy.mapping.MapDocument(mxdFile) for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"): if elm.text == "works": elm.text = "replaceword" mxd.save()
import arcpy import os import glob folder = r"\\sample\sample" oldtext = "Township" newtext = "Borough" mxds = glob.glob(folder + '\\' + '*.mxd') arcpy.gp.overwriteOutput = True for mxdFile in mxds: mxd = arcpy.mapping.MapDocument(mxdFile) for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"): if elm.text == oldtext: elm.text = newtext mxd.save() del mxd