|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
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.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
Quote:
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. |
#4
|
||||
|
||||
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 |
#5
|
|||
|
|||
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. |
#6
|
|||
|
|||
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 |
#7
|
|||
|
|||
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. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VBA to Populate text content controls in word from excel | lmoir87 | Word VBA | 15 | 05-27-2022 04:22 PM |
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 |