none
can we add any object in the header and footer section of a word document that support key-value pair storage RRS feed

  • Question

  • The query is can we add any object in the header and footer section of a word document that support key-value pair storage

    Example:-

                      If we want to display some text in the header and footer section of a document, then the text shown on document is a particular value of a particular key, but if we want to do some operation, then it should be done using the key name in our code


    Monday, January 14, 2019 7:39 AM

All replies

  • Not exactly sure if this is answering your question but you can add two content controls to a document

    CC1 Type is Drop Down List Content Control. Properties set with the display name and value list representing each of the key value pairs

    CC2 type is Plain Text Content Control.

    Now using the XML Mapping Pane, map both CCs to the same xml element.

    Make a selection in the CC1 and the CC2 will display the corresponding value.

    Is that what you wanted to do?

    Wednesday, January 16, 2019 5:51 AM
  • We want to display only plain text part in header and footer

    Wednesday, January 16, 2019 8:13 AM
  • And did you put the CC2 in the above example into the header and/or footer? 

    The location of these CCs doesn't impact the solution - as long as the user can select something from the dropdown CC.

    Thursday, January 17, 2019 4:06 AM
  • This is not what I want to do. I do not want to show two control on my document.

    First I create a document with Name tag in header and save this document template.

    Then anyone can use this template and that name tag in template I want to change according to user name dynamically, Which is different for every user.

    Example:-

    Name  

    here the highlighted name is text displayed in header of document.

    Now user "abc" login and open that template, do some editing and then save. At this save the Name tag should be replaced with "abc" user name.

    Same for another user "xyz" and so on.

    Note:- All these operation I want to do in Header and footer section of a word document, not in body section.
    • Edited by Ver IT Monday, January 21, 2019 8:04 AM
    Monday, January 21, 2019 8:03 AM
  • In that case, all you need is a DOCPROPERTY "LastSavedBy" field in the page header. At most, you might need to refresh the field display after saving the changes.

    It's not apparent what this has to do with 'key-value pair storage' or what you mean by that.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Tuesday, January 22, 2019 9:46 PM