Is there a way to make text selected via drop-down field be repeated throughout a document?

14,238

You can do this for a dropdown list content control in Word 2013, without coding, as long as you are in a position to use one of the predefined Cover Page Properties.

Another consideration is that Content controls only work properly on Windows versions of Word. If you need your document to work on Mac Word 2011 or 2016 you have to work with the legacy forms controls.

Steps:

  • In the Developer tab, display the XML Mapping Pane.
  • In the dropdown in that pane, select "http://schemas.microsoft.com/office/2006/coverPageProps" . You should see a short list starting with "PublishDate".
  • Select your dropdown.
  • Select one of the properties, say "CompanyEmail".
  • Right-click the property name and select "Map to Selected Content Control"
  • To insert a copy of the dropdown value, select the appropriate location in your document, right-click on the property name again, and select Insert Content Control->Plain Text.

You may want to make the control read-only. You can make further copies by copying/pasting that control.

If you can't use the built-in property names - e.g. they are already being used by a cover page in the document - you would have to do some coding. One way is to use some VBA code to insert your own Custom XML Part, in which case you can either do the mapping in VBA or using the above procedure, but mapping to your part. A web search should lead you to information on how to do that. The other way is to modify the XML content of the .docx file (which is also "coding" IMO, and probably less well-documented).

Share:
14,238

Related videos on Youtube

vitesse
Author by

vitesse

I like to consider myself a PC power user who dabbles in code when necessary. The "dabbles" part usually means I have to ask for help when doing more complicated stuff (or even apparently simple stuff sometimes), but I like knowing how things work so getting an answer that helps me learn something new is always exciting.

Updated on September 18, 2022

Comments

  • vitesse
    vitesse over 1 year

    Basically, I have a drop-down list content control with two possible values, Apple and Orange. When I select either one of them, I want that word to be repeated throughout the document.

    Until now, what I used to achieve a similar role are quick parts - document property. But, that only works for words or values that I manually write or copy.

    What I want though, is instead of manually changing the word, to have a way of just selecting the word from a drop-down and have it repeated.

    Having tinkered in Excel a lot lately, a parallel I can draw here is a data validation drop-down menu in one cell, lets say A2 and have another cell, lets say B4, just =A2.

    • CharlieRB
      CharlieRB about 8 years
      Welcome to Super User. Please share with us any research you have done and details of anything you have attempted so far. Have you done any research on how to use Bookmarks in Word for repeating words in a document?
    • vitesse
      vitesse about 8 years
      Thank you. As far as research goes, I have some before posting, including Bookmarks. The problem is that everything I found deals with "static" text - which is written manually by the user. What I need is a way of grabbing and repeating text from a drop-down list, which isn't written by the user (prewritten). Bookmarks, for example basically copy the drop-down (as independent) list, but don't update when changed. Another thing I thought about is if I could nest the drop-down in another field and repeat that "mother" field that would be another way of solving this. Also, thanks for the edit.
    • CharlieRB
      CharlieRB about 8 years
      That is not true. I use drop down list and when tabbing out if it, the reference fields change. How are you making the drop down list? It needs to be from the legacy forms menu, not ActiveX Controls.
    • vitesse
      vitesse about 8 years
      Developer - Drop-Down List Content Control.
  • vitesse
    vitesse about 8 years
    I was wondering why the arrow wasn't appearing next to the legacy drop-down. I'll keep this in mind for future reference. However, having to lock down the file is a problem. It needs to stay editable. That's why I was using the Drop-Down List Content Control. It can be used while editing the document. I was hoping there was a simpler solution.
  • vitesse
    vitesse about 8 years
    Great! This does exactly what I need. I followed your steps and used CompanyFax (honestly, who uses a fax anymore?). Since this file will be used by people who aren't quite as knowledgeable when it comes to computers, I needed something that worked, at least seemingly, in a more easy to use/understand fashion.
  • CharlieRB
    CharlieRB about 8 years
    Although I see you have an accepted answer, for future questions, please ensure all details of requirements are in the question. Otherwise, you end up disqualifying good answers because you didn't explain everything.
  • vitesse
    vitesse about 8 years
    For what it's worth, I did +1 your answer (although apparently it didn't count yet), especially because of the effort you put into very helpfully illustrating exactly what needs to be done. Unfortunately, at the time I didn't know that the document had to be or even could be locked like that. That's why I sometimes prefer asking a question earlier on in my "venture" because even knowing the exact question to ask or explain without a at least a partial understanding of a problem can be more troublesome if attempted in a search engine instead of talking to real people. I really do thank you.
  • CharlieRB
    CharlieRB about 8 years
    It's all good. There are no hard feelings here. My comment was for the sake of improvement. As a community helping each other, with the intent someone else will read your question because they are experiencing the same thing, we want to make sure our questions are as complete as possible so as to avoid misleading answers.