Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-30-2022, 04:49 AM
viewtost viewtost is offline How to get the data on a word document from a different document Windows 10 How to get the data on a word document from a different document Office 2019
Novice
How to get the data on a word document from a different document
 
Join Date: Jul 2021
Posts: 20
viewtost is on a distinguished road
Default How to get the data on a word document from a different document

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
Reply With Quote
  #2  
Old 10-30-2022, 05:54 AM
macropod's Avatar
macropod macropod is offline How to get the data on a word document from a different document Windows 10 How to get the data on a word document from a different document Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,927
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #3  
Old 10-30-2022, 01:41 PM
viewtost viewtost is offline How to get the data on a word document from a different document Windows 10 How to get the data on a word document from a different document Office 2019
Novice
How to get the data on a word document from a different document
 
Join Date: Jul 2021
Posts: 20
viewtost is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
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
Hi Macropod,

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
Reply With Quote
  #4  
Old 10-30-2022, 02:21 PM
macropod's Avatar
macropod macropod is offline How to get the data on a word document from a different document Windows 10 How to get the data on a word document from a different document Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,927
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #5  
Old 10-30-2022, 03:17 PM
viewtost viewtost is offline How to get the data on a word document from a different document Windows 10 How to get the data on a word document from a different document Office 2019
Novice
How to get the data on a word document from a different document
 
Join Date: Jul 2021
Posts: 20
viewtost is on a distinguished road
Default

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
Reply With Quote
  #6  
Old 10-31-2022, 05:09 AM
macropod's Avatar
macropod macropod is offline How to get the data on a word document from a different document Windows 10 How to get the data on a word document from a different document Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,927
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Yes, that's just a variation on #2 in my last reply.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 10-31-2022, 12:57 PM
viewtost viewtost is offline How to get the data on a word document from a different document Windows 10 How to get the data on a word document from a different document Office 2019
Novice
How to get the data on a word document from a different document
 
Join Date: Jul 2021
Posts: 20
viewtost is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Yes, that's just a variation on #2 in my last reply.
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?
Attached Files
File Type: docx All customers testing.docx (12.1 KB, 3 views)
Reply With Quote
  #8  
Old 10-31-2022, 02:23 PM
macropod's Avatar
macropod macropod is offline How to get the data on a word document from a different document Windows 10 How to get the data on a word document from a different document Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,927
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #9  
Old 11-01-2022, 05:21 AM
Charles Kenyon Charles Kenyon is offline How to get the data on a word document from a different document Windows 11 How to get the data on a word document from a different document Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 8,371
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

For more on fields see Dealing with Fields in Microsoft Word. It will get you started.
Reply With Quote
  #10  
Old 11-01-2022, 02:22 PM
viewtost viewtost is offline How to get the data on a word document from a different document Windows 10 How to get the data on a word document from a different document Office 2019
Novice
How to get the data on a word document from a different document
 
Join Date: Jul 2021
Posts: 20
viewtost is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
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.

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
Reply With Quote
  #11  
Old 11-02-2022, 08:05 AM
viewtost viewtost is offline How to get the data on a word document from a different document Windows 10 How to get the data on a word document from a different document Office 2019
Novice
How to get the data on a word document from a different document
 
Join Date: Jul 2021
Posts: 20
viewtost is on a distinguished road
Default

I have found the solution

It is working now. Is it the best way to keep an updated dynamic master file in word?
Reply With Quote
  #12  
Old 11-04-2022, 11:59 AM
viewtost viewtost is offline How to get the data on a word document from a different document Windows 10 How to get the data on a word document from a different document Office 2019
Novice
How to get the data on a word document from a different document
 
Join Date: Jul 2021
Posts: 20
viewtost is on a distinguished road
Default

Hi,

Unfortunately they do not get updated
Reply With Quote
  #13  
Old 11-21-2022, 05:44 AM
macropod's Avatar
macropod macropod is offline How to get the data on a word document from a different document Windows 10 How to get the data on a word document from a different document Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,927
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by viewtost View Post
Unfortunately they do not get updated
What is not being updated? In which document did you make the edits?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #14  
Old 11-22-2022, 10:37 AM
viewtost viewtost is offline How to get the data on a word document from a different document Windows 10 How to get the data on a word document from a different document Office 2019
Novice
How to get the data on a word document from a different document
 
Join Date: Jul 2021
Posts: 20
viewtost is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
What is not being updated? In which document did you make the edits?
Hi Macropod.

I was making the edits in the source files and the destination file was not reflecting the changes
Reply With Quote
  #15  
Old 11-22-2022, 01:08 PM
macropod's Avatar
macropod macropod is offline How to get the data on a word document from a different document Windows 10 How to get the data on a word document from a different document Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,927
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Did you update the fields in the destination file(s)?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
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
How to get the data on a word document from a different document Extracting data from excel document using word 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
How to get the data on a word document from a different document VBA Code for clean all data from ms word document egyp7 Word VBA 4 05-16-2014 03:59 PM
How to get the data on a word document from a different document Help Plz! Link Excel data to Word document cory_0101 Office 1 09-27-2012 07:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:43 PM.


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