Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-11-2023, 04:29 PM
roger.stern@mail.com roger.stern@mail.com is offline Automatically Update Duplicate Fields Windows 10 Automatically Update Duplicate Fields Office 2021
Novice
Automatically Update Duplicate Fields
 
Join Date: Sep 2023
Posts: 13
roger.stern@mail.com is on a distinguished road
Default Automatically Update Duplicate Fields


I have several fields with the same name in a document. Is there a macro that would update the others when I change one of them?
Reply With Quote
  #2  
Old 12-11-2023, 04:44 PM
Guessed's Avatar
Guessed Guessed is offline Automatically Update Duplicate Fields Windows 10 Automatically Update Duplicate Fields Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Use content controls and map them to the same data.

Easiest way to do this is go to Insert > Quick Parts > Document Property and pick one. Do the same for the other locations (or copy and paste the first one to the other locations).

Now you can change that value in any of the Content Controls and the others will update instantly as you click out of the Content Control.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 12-11-2023, 04:49 PM
roger.stern@mail.com roger.stern@mail.com is offline Automatically Update Duplicate Fields Windows 10 Automatically Update Duplicate Fields Office 2021
Novice
Automatically Update Duplicate Fields
 
Join Date: Sep 2023
Posts: 13
roger.stern@mail.com is on a distinguished road
Default

I'm sorry. I used the wrong term. I have two Content Controls with the same name and when I change one, I want the other to automatically update.
Reply With Quote
  #4  
Old 12-11-2023, 04:58 PM
Guessed's Avatar
Guessed Guessed is offline Automatically Update Duplicate Fields Windows 10 Automatically Update Duplicate Fields Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Same instructions still stand.

Or you can go to your Developer Tab (if you have it showing) and click on the XML Mapping Pane button to show that pane on the side of the window. Select the flag (name) of the Content Control and on the XML Mapping Pane, right click on any of the fields and choose "Mp to Selected Content Control". Do the same with the other CCs - choosing the same field each time.

This will work as long as none of those CCs are Rich Text or check boxes.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #5  
Old 12-11-2023, 05:06 PM
roger.stern@mail.com roger.stern@mail.com is offline Automatically Update Duplicate Fields Windows 10 Automatically Update Duplicate Fields Office 2021
Novice
Automatically Update Duplicate Fields
 
Join Date: Sep 2023
Posts: 13
roger.stern@mail.com is on a distinguished road
Default

This is a bit above my expertise range. I tried to bookmark the content control and reference it elsewhere which worked but did not automatically update. Is there a macro or something that will automatically update the referenced book mark when I change the bookmark's content?
Reply With Quote
  #6  
Old 12-11-2023, 05:09 PM
roger.stern@mail.com roger.stern@mail.com is offline Automatically Update Duplicate Fields Windows 10 Automatically Update Duplicate Fields Office 2021
Novice
Automatically Update Duplicate Fields
 
Join Date: Sep 2023
Posts: 13
roger.stern@mail.com is on a distinguished road
Default

I tried your instructions, but the flag name of the content control is not listed in the XML Mapping Pane
Reply With Quote
  #7  
Old 12-11-2023, 05:13 PM
Guessed's Avatar
Guessed Guessed is offline Automatically Update Duplicate Fields Windows 10 Automatically Update Duplicate Fields Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

It would be better if it was but it is far more complex to create a custom field that matches your name. I recommend you just hijack one of the others that are built-in and not being used for their labelled purpose.

If you have a number of fields and want them all in one place then it might be worth going the extra mile but you should make use of the built-in capability first as a test and decide whether you like the functionality enough to bother with the more complex nuances.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #8  
Old 12-11-2023, 09:38 PM
roger.stern@mail.com roger.stern@mail.com is offline Automatically Update Duplicate Fields Windows 10 Automatically Update Duplicate Fields Office 2021
Novice
Automatically Update Duplicate Fields
 
Join Date: Sep 2023
Posts: 13
roger.stern@mail.com is on a distinguished road
Default

Not Sure I understand but I will Try
Reply With Quote
  #9  
Old 12-11-2023, 09:47 PM
Guessed's Avatar
Guessed Guessed is offline Automatically Update Duplicate Fields Windows 10 Automatically Update Duplicate Fields Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

If you want some hand holding while learning the background of Content Controls and mapping them, have a look at Greg Maxey's website and download one of his free add-ins. You could start on this page but there are others there that are very useful resources
CC⁄V⁄BM & DP Tools Add-in
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #10  
Old 12-12-2023, 03:21 AM
gmaxey gmaxey is offline Automatically Update Duplicate Fields Windows 10 Automatically Update Duplicate Fields Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Copy this text to notepad and save it as a .txt file:


<?xml version="1.0"?><Root xmlns="http://TheAnchorage/SimpleXMLPart"><Node1/><Node2/><Node3/></Root>


E.g., lets call it SimpleXMLPart


1. Open Word. If not displayed, display the "Developer" tab.
2. On the Developer tab, click the "XML Mapping Pane" from the "Mapping" group.
3. In the XML Mapping task pane that appears, click the little down arrow and select "Add new part"
4. Navigate to where you saved the .txt file above, select it and click open.
5. Select one of your content controls. In the XML Mapping Task Pane, select the XML Part you just added, select and right click "Node1" and select "map to selected content control".
5. Repeat for the next CC you want mapped to the same node.


Note: for your question, Node2 and Node3 are not used.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically Update Duplicate Fields Update all fields won't update index! Ryhne Word VBA 4 04-23-2020 04:49 AM
Can page fields update automatically? Fabulist Word VBA 2 08-21-2019 11:40 AM
Automatically Update Duplicate Fields Update fields of the same type automatically mqdias Word 3 08-08-2017 03:18 AM
Does Word have an option to update fields AUTOMATICALLY at open??? Jamal NUMAN Word 17 01-27-2012 12:57 AM
Can you make an EDITABLE text box that will automatically duplicate on each page in W dha3 Word 0 08-05-2010 07:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:33 AM.


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