Update Links

M

Matt

I have about 5 links in my Word doc all lnked to 5 different excel files.
They are set to update automattically when the document opens. But if some
one changes the excel file it does not reflect it in the document until I
update the links manually by either goin to edit/links then updating them, or
by right-clicking on each and updating them seperatley, or by opening and
closing the document.

But what I want to have is a commandButton that when clicked it updates all
the links in the document.
 
J

Jay Freedman

Matt said:
I have about 5 links in my Word doc all lnked to 5 different excel
files. They are set to update automattically when the document opens.
But if some one changes the excel file it does not reflect it in the
document until I update the links manually by either goin to
edit/links then updating them, or by right-clicking on each and
updating them seperatley, or by opening and closing the document.

But what I want to have is a commandButton that when clicked it
updates all the links in the document.

The macro you want (assuming you don't need to update things in headers,
footers, text boxes, footnotes, or endnotes) is just

Sub UpdateDocBody
ActiveDocument.Fields.Update
End Sub

You can assign this to a toolbar button
(http://www.word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToToolbar.htm) or
use a macrobutton field
(http://www.word.mvps.org/FAQs/TblsFldsFms/UsingMacroButton.htm).

BTW, the quick keystrokes Ctrl+A (select all) and then F9 (update fields)
would achieve the same thing.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
M

Matt

Thanks. I thought it was something easy I just couldn't figure it out. I
thinks the "Fields" part threw me when I was trying to get it.
 

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