![]() |
#1
|
|||
|
|||
![]()
Hello everybody,
I have a master file called "customers´ master file" where I have all the customers´ details. I also have different files for each customer I have on the master file. How can I do, so each time I make a change to the master file, I get the change made in each customer´s word file? I know that in Excel you can link the files by storing them in the same folder and the using "=" but I don´t know how to do it in Word. Can you please help? Thanks Pascual |
#2
|
||||
|
||||
![]()
You can do that via INCLUDETEXT fields. Using those, the data can be updated in either the source or target document. See: Field codes: IncludeText field
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]() Quote:
Thank you very much for your answer. Indeed, it is a great method. However, I am going to provide more context as I am not sure how to do it. I have two files called Tesco and Sainsburys and a third one called All the customers. In the All the customers one, I want to get all the information from Tesco and Sainsburys and if I add new information/change the information in both files, I want to get the "all the customers" one also updated. They are all in the same folder "Main customers" Would I have to write the following lines in the "all the customers" one to pull the information from both files? {INCLUDETEXT “C:\\Users\\Pascual\\Desktop\\all the customers\\Tesco.docx” information} {INCLUDETEXT “C:\\Users\\Pascual\\Desktop\\all the customers\\Sainsburys.docx” information} Where Tesco is the bookmark in Tesco file for the information that I want to get in all the customers file and Sainsburys the one in the Sainsburys file. Thanks Pascual |
#4
|
||||
|
||||
![]()
Only the destination document needs the INCLUDETEXT field. You can approach the problem in either of two ways:
1. Have a source document listing both Tesco and Sainsburys, with both Tesco and Sainsburys bookmarked appropriately. Then, in each destination document, have an INCLUDETEXT field coded along the lines of: {INCLUDETEXT “C:\\Users\\Pascual\\Desktop\\customers.docx” Tesco}, or {INCLUDETEXT “C:\\Users\\Pascual\\Desktop\\customers.docx” Sainsburys} as applicable; or 2. Have a separate source document for each company. Then, in each destination document, have an INCLUDETEXT field coded along the lines of: {INCLUDETEXT "C:\\Users\\Pascual\\Desktop\\all the customers\\Tesco.docx"}, or {INCLUDETEXT "C:\\Users\\Pascual\\Desktop\\all the customers\\Sainsburys.docx"} You may also find the relative paths discussion in https://www.msofficeforums.com/word/...nal-files.html useful.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
![]()
Thank you Macropod,
Sorry, I should have explained better what I want to achieve. My destination file is "all the customers" and my two source files are "Tesco" and Sainsburys". In the destination file I want to pull the information contained in each source file. My question is, where do I have to write the codes above? Ie. {INCLUDETEXT "C:\\Users\\Pascual\\Desktop\\all the customers\\Tesco.docx"}, {INCLUDETEXT "C:\\Users\\Pascual\\Desktop\\all the customers\\Sainsburys.docx"} So I get in the same destination file both companies´information? Thanks Pascual |
#6
|
||||
|
||||
![]()
Yes, that's just a variation on #2 in my last reply.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
![]()
Hi Macropod,
Thanks again for your help. I am sorry but I have not explained myself properly. So in the "all the customers" file (destination file), I have put this two lines: {INCLUDETEXT "C:\\Users\\Pascual\\Desktop\\all the customers\\Tesco.docx"}, or {INCLUDETEXT "C:\\Users\\Pascual\\Desktop\\all the customers\\Sainsburys.docx"} But I have put them in the file, so I have not put them in the visual basic editor. Whereabouts in the destination file do I have to put the lines above? |
#8
|
||||
|
||||
![]()
You put the fields wherever you want the output to appear. This is field coding - it has nothing to do with VBA.
In your sample document, all you have is text representations of the fields. You can't simply type the field braces (i.e. {}) or copy/paste them from here - they must be created in pairs via Ctrl-F9, or via Insert|Quick Parts>Field:IncludeText.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#9
|
|||
|
|||
![]()
For more on fields see Dealing with Fields in Microsoft Word. It will get you started.
|
#10
|
|||
|
|||
![]() Quote:
Thanks Macropod. I am going to list my steps here as I am still getting an error: 1. Open my destination file "all customers" 2. click on insert > Quick parts > Field > category link and references > IncludeText > Field Codes > then I enter INCLUDETEXT "C:\\Users\\Pascual\\Desktop\\Word master file and files\\Sainsburys"Sainsburys Word master file and files is the folder on my desktop where the source file "Sainsburys" is saved. The last word (Sainsburys) is the name of the bookmark on the source file "Sainsburys" that I want to have in my destination file "all customers". Then, I click ok and get the above into { } and when I toggle (alt F9), it says Error! Not a valid file name. Can you please help? Thanks Pascual |
#11
|
|||
|
|||
![]()
I have found the solution
![]() It is working now. Is it the best way to keep an updated dynamic master file in word? |
#12
|
|||
|
|||
![]()
Hi,
Unfortunately they do not get updated |
#13
|
||||
|
||||
![]()
What is not being updated? In which document did you make the edits?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#14
|
|||
|
|||
![]() Quote:
I was making the edits in the source files and the destination file was not reflecting the changes |
#15
|
||||
|
||||
![]()
Did you update the fields in the destination file(s)?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to extract bookmarked data from Word document and insert into another Word Document | VStebler | Word VBA | 3 | 05-03-2018 05:02 PM |
![]() |
PRA007 | Word VBA | 18 | 11-27-2015 11:17 PM |
Integrating Excel Data into Word Document | mruetz | Word | 4 | 03-06-2015 12:27 PM |
![]() |
egyp7 | Word VBA | 4 | 05-16-2014 03:59 PM |
![]() |
cory_0101 | Office | 1 | 09-27-2012 07:15 PM |