|
From: Matt on 24 Jun 2008 11:33 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.
From: Jay Freedman on 24 Jun 2008 12:27 Matt wrote: > 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 FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
From: Matt on 24 Jun 2008 12:36 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. "Jay Freedman" wrote: > Matt wrote: > > 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 FAQ: http://word.mvps.org > Email cannot be acknowledged; please post all follow-ups to the newsgroup so > all may benefit. > > >
|
Pages: 1 Prev: Calling form fields by string-name? Next: inserting blank line |