Update all Word links

MDF -  
 MDF -
Hello,

I have a small issue that you will surely be able to resolve.
I currently have about a hundred links from an Excel 2013 file to Word 2013,
which allows me to create an automated offer template with some Excel fields to fill in that will update the entire Word document.

The master Excel file is protected in its cell arrangement and is not supposed to change over time.

However, for each offer "Project1" made, I wish to save a Word file and its corresponding Excel file with the name "Project1".

Currently, I proceed by:
1) opening my "template" Word
2) immediately saving this Word separately as "Project1"
3) in "Project1.docx", file -> info -> edit links to files -> open source (of the first link)
4) I rename and save this Excel file elsewhere as "Project1"

5) I then try to select all my links --> change source.

However, my problem is that I have to select the same file for each source as many times as I have links.
Do you have a better solution to do this in one go (I plan to eventually increase my number of links)?

Thank you in advance,
MDF

Configuration: Windows 7 / Chrome 45.0.2454.101

1 answer

m@rina Posted messages 27415 Registration date   Status Moderator Last intervention   11 562
 
Hello,

There’s one thing I don’t understand: since Excel files are not meant to be modified, why copy them every time?

Otherwise, in your method, not everything is in line with established Word practices! :)
1) opening my Word "template"
You don’t open a template; you create a new document based on that template, which already prevents modifications and saves under the same name. A template has a dotx extension and is placed in the Templates folder. To create a new document: File => New and choose the template.

m@rina

--
There’s no shame in not knowing everything, but taking credit for other people’s work is the most despicable thing... Please cite your sources!
0
MDF
 
Marina,

thank you for your quick response.
The Excel file is not modified in its structure but is in the content of the cells with each offer. So if we ever want to go back to a previously edited offer, we need to start from scratch.

Thank you for the template advice.

However, do you have an answer to my initial question about changing all the sources in the Word file at the same time?
I tried using alt+F9 while doing "ctrl+H - replacing the old link with the new one": it works in the open document. However, when I close this document and reopen it, it reverts to the original links...

Thank you.
0
m@rina Posted messages 27415 Registration date   Status Moderator Last intervention   11 562
 
It's strange because it's exactly the solution to adopt. There is no reason for the initial links to reset on their own if you saved your file before closing. And I emphasize that you don't even need to go into the links dialog box.

I just did a test again, and I have no issues with it. The links are indeed modified.

Otherwise, you need a macro, but Word is managing OLE objects less and less well through macros. This macro:

For Each tablo In ActiveDocument.InlineShapes
If tablo.Type = wdInlineShapeLinkedOLEObject Then
With tablo.LinkFormat
.SourceFullName = "D:\..... .xlsx" 'put the new link
.AutoUpdate = True
End With
End If
Next


I'm not sure it's going to work with the latest versions. With 2016 for example, it doesn't work, it doesn't recognize Excel objects as InlineShapes, nor as Shapes... Otherwise, it should work with an older version.

So of course you can make a macro to modify the fields, but that amounts to doing a search and replace.

nbtablo= ActiveDocument.Fields.Count
For x = 1 To nbtablo
ActiveDocument.Fields(x).LinkFormat.SourceFullName = "D:\..... .xlsx"
Next x


Be careful because this last code is drastic as it replaces all the links in all the fields. So, if there are other fields with other links, it's best to avoid it.

If you want to test the macros, do it on a copy.

m@rina
0
MDF > m@rina Posted messages 27415 Registration date   Status Moderator Last intervention  
 
Marina,

thank you.
As for the macros, I will give up. I will try alt+F9 and limit the modifications to the file.
Best regards,
MDF
0