Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-31-2022, 04:10 PM
WordUnknown WordUnknown is offline How to use content controls to populate text throughout the same document? Windows 11 How to use content controls to populate text throughout the same document? Office 2021
Novice
How to use content controls to populate text throughout the same document?
 
Join Date: Oct 2022
Posts: 5
WordUnknown is on a distinguished road
Default How to use content controls to populate text throughout the same document?

Hello,

I have uploaded a document which explains with pictures what am I am doing, however I will paste the text in this message just in case anyone does not feel comfortable downloading and opening a random word file from the internet.



Forename: Jane

Surname: DOE


As you can see above, this is a simple table and in the second column are two Plain Text Content Controls.

The first Plain Text Content Control has the following properties:



I do not want the box to be able to be deleted, although this document will NOT be restricted.

I have created a new style with the same name as the Plain Text Content Control tag called ‘forename’. This style has not been edited anyway and only the styles name has been changed.

This setup for the surname Plain Text Content Control is exactly the same, except for the tag name and style name, which is ‘surname’.

The documents that I will be creating will have numerous references to the Plain Text Content Controls I have previously mentioned and there may well be a lot more in the future. I’m not well versed on Microsoft Word and have only found this ‘way’ of doing things in approximately a day or two, so I am checking that I am doing this the right way to prevent issues further down the line.

To reference the text inside the Plain Text Content Control, I am using STYLEREF like so: { STYLEREF forename } which when wrapped properly, shows the forename as Jane

Surely, there has to be an easier way without using VBA, Macro’s, just a simple solution to link text to each other so that it automatically updates in the body, header and footer without doing any sort of dodgy hacks?

Thanks for reading.
Attached Files
File Type: docx Forename.docx (106.8 KB, 10 views)
Reply With Quote
  #2  
Old 10-31-2022, 09:30 PM
gmayor's Avatar
gmayor gmayor is offline How to use content controls to populate text throughout the same document? Windows 10 How to use content controls to populate text throughout the same document? Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You could map the fields.A simple way to do this would be to use Insert Content Control Add-In.

Use the function to edit the fields to add the mapping option, then copy and paste the controls wherever you want them. Whatever you type in any of them will be repeated in the others - see attached.
Attached Files
File Type: docx Forename.docx (112.0 KB, 9 views)
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 11-01-2022, 03:23 AM
WordUnknown WordUnknown is offline How to use content controls to populate text throughout the same document? Windows 11 How to use content controls to populate text throughout the same document? Office 2021
Novice
How to use content controls to populate text throughout the same document?
 
Join Date: Oct 2022
Posts: 5
WordUnknown is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
You could map the fields.A simple way to do this would be to use Insert Content Control Add-In.

Use the function to edit the fields to add the mapping option, then copy and paste the controls wherever you want them. Whatever you type in any of them will be repeated in the others - see attached.
Hello gmayor,

Does this add-on need to be installed on my work laptop for it to work properly? There may be some security issues work would not be happy with.

Kind regards.
Reply With Quote
  #4  
Old 11-01-2022, 05:13 AM
gmayor's Avatar
gmayor gmayor is offline How to use content controls to populate text throughout the same document? Windows 10 How to use content controls to populate text throughout the same document? Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The short answer is yes it does. However you can apply the same methodology using Microsoft's own built-in functionality. It is just a lot more complicated to get your head around.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #5  
Old 11-01-2022, 05:19 AM
Charles Kenyon Charles Kenyon is offline How to use content controls to populate text throughout the same document? Windows 11 How to use content controls to populate text throughout the same document? Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,125
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

Look also at Repeating Data Using Document Property Content Controls and Other Mapped Content Controls.

Templates/documents with mapped Content Controls will work on any computer running Office 2007 or later including Macs but not the online version or mobile versions.

The Add-In Graham suggested needs to be on the computer creating the template but not needed on computers using it. I have used the Add-In and think it is super. However, using repurposed Document Property Controls, as described in the link may meet your needs. There are other ways to create mapped content controls as well without adding any software or add-ins. However, those methods require a level of technical expertise most of us do not have, as well as a fair amount of time.

Last edited by Charles Kenyon; 11-01-2022 at 11:11 AM.
Reply With Quote
  #6  
Old 11-01-2022, 10:32 AM
kilroyscarnival kilroyscarnival is offline How to use content controls to populate text throughout the same document? Windows 10 How to use content controls to populate text throughout the same document? Office 2021
Expert
 
Join Date: May 2019
Posts: 344
kilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nice
Default

Have you considered the much simpler Bookmark and Cross Reference? I find this works well to repeat names and titles and such on the fly. You simply highlight the forename in the first place it appears, do Insert Bookmark, and give it a name (like Forename), and the same for Surname. Where you want them to reappear, use Insert Cross Reference, and choose the bookmarks you want.

The only slightly tricky part for me about this is that if I'm working with documents and coworkers are going to be in there too, they should have "show bookmarks" checked in their Advanced Settings, so that they see the brackets surrounding the original bookmarked text. Otherwise, they tend to backspace-delete the brackets and not understand why they broke it.

I've also tried this method I found on YouTube. Basically you create a pop-up form that comes up when you first open a template, where you fill in the pertinent information. Then you close it, and it populates the document in the fields. The advantage of this is that the form isn't visible/printable, and yet it won't be deleted. https://www.youtube.com/watch?v=5adLGJjVYWY

Ann
Reply With Quote
  #7  
Old 11-01-2022, 11:08 AM
Charles Kenyon Charles Kenyon is offline How to use content controls to populate text throughout the same document? Windows 11 How to use content controls to populate text throughout the same document? Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,125
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

Hi Ann,

Have you tried repurposing the built-in Document Property Content Controls? It is quite simple and requires no programming. If you have not, please take a look at my page. Such controls update automatically and a change in one is reflected in all copies. IMO, this is simpler and also more robust than the bookmark/cross-reference method.

The second method you refer to is much more flexible and powerful but does require programming skill. It is a UserForm which is a custom dialog box. Changes made in the body of the document, though, are not automatically reflected elsewhere in the document nor in the UserForm. To me, the video is problematic because it starts with a document rather than a template (bad idea).

See: Create a Simple Userform by Graham Mayor, MVP

If all you want is repeating data, IMO, mapped content controls are almost always the way to go because of the instant updating. Userforms are incredibly powerful and flexible but require more skill to set up.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use content controls to populate text throughout the same document? VBA to Populate text content controls in word from excel lmoir87 Word VBA 15 05-27-2022 04:22 PM
How to use content controls to populate text throughout the same document? Rich text/Plain text Content Controls in Template michael.fisher5 Word 9 11-19-2014 06:36 AM
More than one content controls in a word document lucky16 Word VBA 6 07-10-2014 08:34 AM
Disabling content controls and protecting document sections. Catty Word VBA 2 11-29-2013 05:10 AM
Using both rich and plain content controls in one document Erica.Black Word 0 06-18-2013 10:33 AM

Other Forums: Access Forums

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


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