VBA to update links in Word

P

Peter Baute

Hi there!

I continiously receive word-documents with graphics in it (about 130,
the exact number is variing). The graphic-files are stored seperately in
a different directory. My task is to make the pictures visible. In order
to do that I have to select and update each single link seperately
(which is kind of frustrating: EDIT/LINKS/UPDATE) The dialogue allows me
to select all links at one time but it will not update all at one time.

What VBA routine will do that job for me? What is the objectname that
has to be updated?

Should be something like

For i = 1 to object_type.count
i.update
next i


Any hint will be appreciated. - Thanks in advance,
Peter
 
G

Graham Mayor

Doesn't CTRL+A then F9 work?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
P

Peter Baute

CTRL+A works only for a subset of pictures. The rest will have to be
updated one by one.

By the way: If I am able to address the objects individually I may also
be able to adjust their paths. (Because about 20% of them have abslute
filepaths, the rest relative filepaths.)

Regards,
Peter
 
M

macropod

Hi Peter,

Take a look at the code in my Field Link Updater:
http://www.wopr.com/index.php?showtopic=250058&st=20&p=261488&#entry261488

Alternatively, to see how to implement relative paths in Word, check out the solution I've posted at:
http://www.wopr.com/index.php?showtopic=670027&st=0&p=670027&#entry670027
I note that you've said some of your links have relative filepaths, but Word doesn't provide support for relative filepaths - the
nearest it gets is a 'hyperlink base'. Omitting the filepath from a link doesn't make it relative.
 

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