I've very new to coding anything so sorry if this is an easy fix.
When I export my map, everything is fine and my script replaces the text perfectly. However, when I open my map document manually to visualize it, the text is still the same as before I replaced it. I've even exported one of the maps from that folder without replacing text and it shows that the text has been replaced. I'm not sure what's going on. I used arcpy.RefreshActiveView as well, before mxd.save() and it still doesn't work. Any help would be appreciated.
import arcpy
import os
import glob
folder = r"C:\Workspace\MapTest"
oldtext = '7351'
newtext = '7352'
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
eps = mxdFile.replace('mxd', 'eps')
arcpy.mapping.ExportToEPS(mxd,eps)
mxd.save()
del mxd
Also, I'm not really sure how to export my eps documents into another folder. I would be grateful for help on that as well.