View Single Post
 
Old 02-23-2016, 02:51 PM
pmcpowell pmcpowell is offline Windows 8 Office 2013
Novice
 
Join Date: Feb 2016
Posts: 6
pmcpowell is on a distinguished road
Default Finding And Updating "ref" Fields Using Code

Hi - This is my first post in the Forum - I posted to Utter Access which has a Word forum but they thought that you would be better equipped to answer my question:

I have created an 18 page document which contains many "Ref" Fields which are updated from Bookmarks which are accessed through a single Data Page. I have created an update MacroButton which I recorded the actions of Goto the "DocStart" Bookmark - CTRL+Shift+END to select the entire document from that point onward and then Fn+F9 to update all of the fields contained within that range.

The button seems to work in that it runs the macro but does not always update all of the Ref Fields. When I don't use the MacroButton and just perform the actions, it seems to update more of the fields but not always all of them.
I must add that some of the fields are inside Tables and Text Boxes, but not in Headers or Footers. However there is no clear condition which applies to all of the non-updating fields.

I was wanting to create code to loop through all of the "Ref" Fields and Update individually but I cannot seem to extract the contents of the fields in ordr to identify them using the "ActiveDocument.Fields.Item() but haven't been successful as if I try to populate a variable using that code, I get a Type Mismatch error.

As I want to share this document with other Coworkers I would love to have complete automation.

Any help would be greatly appreciated.

Peter
Reply With Quote