none
Content control loses font formatting when using custom XML

    Question

  • Here are the steps to reproduce the problem I am having.  I am essentially following the instructions from this article http://blogs.msdn.com/acoat/archive/2007/03/01/linking-word-2007-content-controls-to-custom-xml.aspx.

     

    1. Create a Word docx with a Text content control.  (That's the only thing added to a blank document.)

    2. Format the content control as a Wingding font and save the file.

    3. Open the same document in the Word 2007 Content Control Toolkit.  Create a custom XML part which contains one value.  For example...

     

    <root>

    <Test>123</Test>

    </root>

     

    4. Link the Test node to the one content control, save the docx, and close the Content Control Toolkit.

    5. Open the docx in Word 2007.  The content control will display it's value with a Times New Roman font.  This is obviously not desirable.

     

    I can change the font back to Wingding, but when I reopen the the docx, it's back to Times New Roman.  I can change the value of the content control so that the custom XML persists the value, so I know the XPath linking is working.  It may seem superfluous that the Wingding font doesn't work; however, I am using the Wingding font just for this example, because it is a standard font.  My ultimate goal is to use a third party font that is exibiting the same behavior as the Wingding font.

    • Moved by Ji.ZhouModerator Tuesday, November 9, 2010 9:22 AM (From:Innovate on Office)
    Tuesday, October 9, 2007 8:18 PM

Answers

  • Hi,

     

    Thanks for sharing the information with us. This issue has been identified as a possible bug. We have filed the bug with the product team. I will update this post on receiving any information from the product team.

     

    Thanks,

     

    Harjit.

     

    Wednesday, October 17, 2007 7:48 PM

All replies

  •  

    Hi,

     

    Thank you for contacting Microsoft Innovate On Office Advisory Services.

     

    The following is the details of your request:

     

    [Support Request Description]:

    - The font changes to "Times New Roman" after following the steps mentioned in your request above.

     

     

    [Next Step]

    - The issue is reproduced at my end as well.

    - I am working with the word team to figure out if this is a limitation or a design issue.

    - I will update you after receiving any information from the word team.

     

    Thanks.

     

    Harjit.

    Thursday, October 11, 2007 3:51 PM
  • Matt Scott at Word 2007 Content Control Toolkit provided the following steps to reproduce this bug only using Word.

     

    REPRO STEPS:
    ===========

    1. Boot Word
    2. Go to Developer Tab | Insert Plain Text Content Control
    3. Change the font of the control's text to Wingding
    3. Open VBA editor, Alt+F11. In the immediate window, copy paste the following code and then press ENTER

    ActiveDocument.CustomXMLParts.Add("<x>foo</x>")

    4. Now copy paste the following code and press ENTER

    ActiveDocument.ContentControls(1).XMLMapping.SetMapping "/x"

    ACTUAL RESULTS:
    ============

    The content control text is replaced by foo and the font is times new roman.

    EXPECTED RESULTS:
    =============

    The placeholder text font is not blown away when the content control is updated

    NOTES:
    =====
    I've verified even after changing the font of the content control again, the font is still reverted upon update. Additionally this behavior reproduces when using styles.

     

    Friday, October 12, 2007 2:51 PM
  • Hi,

     

    Thanks for sharing the information with us. This issue has been identified as a possible bug. We have filed the bug with the product team. I will update this post on receiving any information from the product team.

     

    Thanks,

     

    Harjit.

     

    Wednesday, October 17, 2007 7:48 PM
  •  

    Hi Harjit,

     

    Is this bug resolved in word 2007? Is there any patch or bulletin for this?

     

    Thanks,

    Ashish Sayal

    Thursday, January 24, 2008 12:20 AM
  • Harjit,

    Just to make sure: When you changed the font of the control's text to Wingdings, did you change it through the content control's properties sheet?

    - Jarno

    Friday, February 27, 2009 6:35 AM
  • This behavior (bug) is quite a problem for me too. Any news on some workaround or patch?

    Peter
    Thursday, July 2, 2009 11:20 PM
  • I too am finding this bug. What is the status of the patch?
    Friday, November 5, 2010 9:41 PM
  • Bless your hearts! I thought I was going crazy and I've spent hours trying to troubleshoot this thing and trace it back to the underlying fonts in normal.dotm in 2007.

    Is it still officially a MS bug or has a patch or workaround been found?


    Nancy Maze
    Thursday, October 27, 2011 11:03 PM
  • Hi,

    In regards to this issue is there a resolution available? Thank you for your time.

    Quik

     



    • Edited by Quiksmith Friday, November 18, 2011 9:28 PM
    Friday, November 18, 2011 9:27 PM
  • One question, if you change a customxml, linked with a content control, in runtime, it's necesary close and open de document to see changes in your content control ?????
    Wednesday, March 21, 2012 11:57 AM
  • It's amazing to see that this bug is still present after 5 years. Way to go Microsoft! 
    Friday, January 11, 2013 1:42 PM
  • And it's still present in Office 2013 8 years later, possibly in 2016 as well. Is there not even a work around? By the way this is not limited to custom XML parts. A standard text control etc. will revert to Times New Roman as well if the document is saved, re-opened, and the placeholder text is deleted.

    Edit: Ok, so I have found a possible workaround for this issue. However I stress this works ONLY if you are using a single font and I only tested it with my particular issue.

    Open up the style manager, this is buried under the style dialog on Word 2013. On the tab "Set Defaults" you can change the fall back font to whatever you like. When the placeholder text is deleted it reverts to the default font instead.

    Unfortunately, this issue also seems to occur when the value is set by something else. For example... I made a codeless "radio selection" for Office 2007 backward compatibility. It consists of two or more dropdown lists each set to the same document property. The display values on each list are set to blank for everything that is not the selected option. This way when you choose the option from a different box all others become blank like a radio button. This works perfectly if the font is standard but not for wingdings as it reverts every time to Times New Roman. Sadly standard fonts don't have such things as ticks or shapes etc. :(

    • Edited by Dragonranger Thursday, October 22, 2015 11:16 AM Updated with possible solution and other issues
    Thursday, October 22, 2015 10:53 AM
  • Hi

    I am also facing the same issue while using custom XML parts. Have you got any solution?

    If my windows region setting is "English UK" then all works well but if I choose it to "Polish" then some of the fonts are not used instead "Times New Roman" used in my word template.

    Can anyone please explain the reason behind it?

    Regard

    P


    • Edited by jain_p99 Monday, June 13, 2016 11:31 PM
    Monday, June 13, 2016 11:26 PM