Update links

E

emferrari

Hello

I have a word document that has some links to other doc files, such as
a default signature.

My company will change the address and I don't want to go to every
single document (1500+) and update the links.

I want to write a program to go to this documents and do the function
update link as they are with the option "Manual update" enabled.

I tried to record a macro of that but I think it's not possible to
record a macro for this operation.

Someone has already done something similar and could give me a tip in
how to start building this application?

Thanks!

Eduardo
 
D

Dave Lett

Hi Eduardo,

In pseudo-code then, you want to

1. Open all documents
2. Update all fields in every storyrange
3. Save Document
4. Close document

You can accomplish 1. by using the code in one of these two articles:
"How to read the filenames of all the files in a directory into an array" at
http://word.mvps.org/faqs/macrosvba/ReadFilesIntoArray.htm (you will use this
one if all the documents are in the same folder--no subfolders)

If, however, you do not have the documents in a single folder, but in a
"master" folder with several subfolders, then you will want to use the above
combined with the article "How to get the names of all the folders in the
folder tree, starting from a specified folder" at
http://word.mvps.org/faqs/macrosvba/ReadFoldersIntoArray.htm

This will certainly get you started. After that, you'll want to be able to
ACCESS every storyrange in the document. To do that, you can borrow a portion
of the code from the article "Using a macro to replace text where ever it
appears in a document including Headers, Footers, Textboxes, etc." at
http://word.mvps.org/FAQs/MacrosVBA/FindReplaceAllWithVBA.htm

Once you combine these, saving and closing is easy.

Hope this gets you started,

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top