Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-14-2020, 08:05 AM
steve78 steve78 is offline Update fields with varying information across multiple files Windows 10 Update fields with varying information across multiple files Office 2016
Novice
Update fields with varying information across multiple files
 
Join Date: Oct 2020
Posts: 2
steve78 is on a distinguished road
Default Update fields with varying information across multiple files

Hello --

I have a set of about 200 Word files, all built off the same template. Each contains several custom properties that are unique to each file such as a document ID, release date, and version. These properties are reflected in fields that appear both in the body of the documents as well as in the headers and footers. I have all the metadata in a spreadsheet, but I need to merge it into the files themselves. Does a VBA solution (or something else) exist to attack such a problem? Happy to provide more details if necessary.

Thanks,
Steve
Reply With Quote
  #2  
Old 10-14-2020, 11:01 AM
Charles Kenyon Charles Kenyon is online now Update fields with varying information across multiple files Windows 10 Update fields with varying information across multiple files Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 6,989
Charles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to beholdCharles Kenyon is a splendid one to behold
Default

See the articles about Document Properties in this MVP FAQ index page:
Word Macros and Visual Basic for Applications (VBA) FAQ

You are first updating the properties. Are you sure you need to update the fields? That will require opening each file.

Here are links to two free utilities for batch handling files. You can use them to run your code.
Reply With Quote
  #3  
Old 10-14-2020, 12:09 PM
steve78 steve78 is offline Update fields with varying information across multiple files Windows 10 Update fields with varying information across multiple files Office 2016
Novice
Update fields with varying information across multiple files
 
Join Date: Oct 2020
Posts: 2
steve78 is on a distinguished road
Default

Thanks for the pointers, Charles. Unfortunately getting access to the document properties is only half the problem, because the docs have different metadata -- for example, each document has a different ID, a different release date, and a different version. It seems to me (and maybe I'm missing something) that the links you provided all assume I'm making the same modifications in all the documents. What I was hoping for is some way to tie the VBA to an Excel sheet or some other source that contains all that info. Do you think that's possible?
Reply With Quote
  #4  
Old 10-14-2020, 02:23 PM
Guessed's Avatar
Guessed Guessed is offline Update fields with varying information across multiple files Windows 10 Update fields with varying information across multiple files Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 1,983
Guessed is a name known to allGuessed is a name known to allGuessed is a name known to allGuessed is a name known to allGuessed is a name known to allGuessed is a name known to all
Default

Steve,

Yes it is possible but it isn't completely trivial and there isn't a one-size fits all solution. There are multiple places where metadata can be saved (custom xml, built-in and custom document properties, document variables) and because of this, there are multiple ways to connect content in the document to those document variables.

Are you looking for a big-bang approach macro to CREATE all 200 documents at once or do the documents already exist and you want to have them REFRESH their variables from the Excel source? Option 1 is more straightforward since you will have consistent structure to work from. If the documents already exist then there is a lot of extra validation that must take place to ensure the 200 docs contain what the macro expects.

From your post, it appears you already have the 200 docs and want to refresh the metadata. Charles' links are directly applicable to that 'process' but you will need to use the vba framework available in those links to process the Excel data and update it in each of the relevant docs. If you need assistance to get going on this, you will need to post a sample Excel workbook and a representative Word document so that we can see where the metadata is being saved in the Word docs. If the field titles don't match in both the source spreadsheet and Word docs then we would need a mapping table as well.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update fields with varying information across multiple files Include multiple (but varying in number) Excel rows in each separate email mrjimi Mail Merge 3 12-10-2017 09:45 AM
Update fields with varying information across multiple files Summarise information from multiple worksheets in multiple files alistair_ Excel Programming 5 04-10-2017 08:27 AM
Update fields with varying information across multiple files Macro to open Multiple files and copy information to a master file gbaker Excel Programming 2 04-08-2016 08:44 AM
Update fields with varying information across multiple files I want to use formula to auto update cells with information Steve81uk Excel 15 01-09-2015 12:58 PM
auto populate fields for multiple files w/in folder jbyrd Word 0 07-21-2014 07:35 AM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 07:26 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft