none
Update the content control values RRS feed

  • Question

  • The included Word templates contain content controls. With some of these controls you can display an entered the same value more often in a document, such as Your name. And this without the need to make the document a form or using a macro.

    Is there anyone who knows how to do this?




    Tuesday, April 23, 2019 9:14 PM

Answers

  • Hi Paul,

    I respect you for wanting to help me, but you did not understand my question at all. Do you really think I don't know what a footer is in Word? That I don't know that we can link controls? Also I did not asked how to achieve my goal with VBA.

    I understand that my English is too limited and that can cause miscommunication. At the same time, it is also important that you can read things objectively.

    I have discovered that XML is needed for what I want to achieve. This in combination with controls. That is what has been applied in the templates that come with Office 365. I understand that this technique is unknown to you.

    Thanks again for your time.



    Thursday, April 25, 2019 7:44 AM

All replies

  • Is this a homework question? Your description refers to "included Word templates contain content controls", in which case it seems you already have access to all you need.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Wednesday, April 24, 2019 12:54 AM
  • Hi Paul,

    My question is not a homework question. I am a VBA developer.

    In the same way that you can add content controls, I want to be able to add those controls as in my question. (Tab Developers > Controls)
    There are examples of this in the provided Word templates, but I cannot find any information to achieve the same goal.

    It works in much the same way as with a Word field code Ref, but it is not the same. The additional copies of the control in the supplied templates are immediately updated as soon as one is changed.


    Wednesday, April 24, 2019 7:17 AM
  • Perhaps you could clarify what you want to do. Your references to "included Word templates" and "provided Word templates" when you haven't provided links to any such templates hardly makes anything clear.

    Content controls are easily added to a document via VBA (though manually adding them to the template a document is to be based on is generally the preferred method) and, depending on what you want to achieve can be linked to other content controls and/or grouped.

    Document_ContentControlOnEnter and Document_ContentControlOnExit macros (amongst others) can also be used to determine what happens when you enter & exit a content control. See, for example:


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Wednesday, April 24, 2019 9:36 AM
  • Hi Paul,

    My question is not to do this with VBA. It is probably due to my poor English. I will try to explain it differently.

    In Word (Office 365) go to File and choose New.

    You can then choose a template. In my language (Dutch) I choose "Zakelijke brief", in English this will be "Business letter".

    In the document that is taken from the template, there is a content control with the tekst "Uw naam" (above). In English this will be "Your name". The same control is displayed at the bottom of the letter where the name is displayed. If one of these controls is updated, both will be updated.

    This kind of control behaves differently from the others. My question is how I can create such a control (with this behavior) without using a template.

    Thanks.

    Wednesday, April 24, 2019 10:40 AM
  • Paul,

    I think this special technic should be done by using XML. 

    Wednesday, April 24, 2019 10:54 AM
  • Your images suggest someone has used some quite ordinary plain text content controls, to which they've added some titles and customised the placeholder text. There is nothing special about that; it can all be done through Developer>Controls when Word is in Design mode - also accessed via Developer>Controls. The display in your screenshot indicates that Word is already in Design mode.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Wednesday, April 24, 2019 12:25 PM
  • I know that. This is all known to me and nothing new. But you miss my question. I'm sorry I can't explain to you what I mean. Thank you for your effort.
    Wednesday, April 24, 2019 12:30 PM
  • As I said in a previous reply, Content Controls can be linked. That's all you need to replicate content 'at the bottom of the letter'.

    If your content 'at the bottom of the letter' is actually in the page footer, you don't even need a second content control; all you need do is apply a unique Style name to the range spanned by the relevant content control, then use a STYLEREF field in the footer referring to the Style's name.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Wednesday, April 24, 2019 11:53 PM
  • Hi Paul,

    I respect you for wanting to help me, but you did not understand my question at all. Do you really think I don't know what a footer is in Word? That I don't know that we can link controls? Also I did not asked how to achieve my goal with VBA.

    I understand that my English is too limited and that can cause miscommunication. At the same time, it is also important that you can read things objectively.

    I have discovered that XML is needed for what I want to achieve. This in combination with controls. That is what has been applied in the templates that come with Office 365. I understand that this technique is unknown to you.

    Thanks again for your time.



    Thursday, April 25, 2019 7:44 AM
  • I have discovered that XML is needed for what I want to achieve. This in combination with controls. That is what has been applied in the templates that come with Office 365. I understand that this technique is unknown to you.

    Your assertion that I don't know the technique is utter nonsense. Whether XML coding is needed depends on what your document requirements are - which you have quite spectacularly failed to explain.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Thursday, April 25, 2019 12:34 PM