I have multiple MXDs which have linked Word documents added using Insert Object. These Word documents change frequently and need to be updated in the maps. The only way I have found so far, from searches and Esri documentation, requires the MXD to be opened and the linked object double-clicked.
I'm looking for a way to do this using ArcPy, so that the process can be done in batch and without manual MXD opening.
Is there a way to refresh linked objects inserted into ArcMap without manually opening each MXD using ArcPy?
This is in ArcGIS Desktop 10.6.
Best Answer
The refreshing of a linked Word document does not automatically happen as you have discovered and stated in the KB document. Amazingly this was reported in 2016 and ESRI have still (and I guess highly unlikely) not fixed it.
But all it not lost! I experimented with some code, running it in the Python console in Arcmap and I managed to get the layout linked object to refresh.
The trick is that the object must be named uniquely to identify it from all other graphic elements in the layout. I used a simple naming convention of "w0", I will explain the number portion a bit later.
First ensure you linked correctly as shown below (note checkbox tick):
Now ensure our linked word document object has the name "w0"
Now here is the code:
The code locates the element by name, increments the number portion so w0 becomes w1 , then clones it and deletes the old graphic element. Final step is to reset the name for the cloned element back to the format w1. The act of cloning and resetting its name has the effect of double clicking on the element to get it to refresh.
Note: I ran this from the python console within ArcMap and it worked well, I have not tried to run it outside an ArcMap session, that's for you to explore if need be.