none
Get "Invalidate data format" error when I reference one Word template to second RRS feed

  • Question

  • Hello

    Background:

    Office 2007 SP2, Windows XP Professional SP3

    The first template called Template1.dotm without any Ribbon code

    The second template called Template2.dotm with this code for Ribbon

    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
         onLoad="myRibbon_IRibbonUI_onLoad">
    </customUI>
    
    ( It's just for testing, I've noticed that doesn't matter if I have full ribbon code or only these 2 lines, Word always shows up the error message )

    Workaround

    For some reason I need to have a reference from the Template1.dotm to the Template2.dotm ( you know, Go to the "Tool" menu then References, then Browse find the template and that's it ) If I reference these two templates, I am able to call code from Template2.dotm like this

    ' I am in the Template1.dotm
    Call Template2.MycodeInTemplate2
    

    Then I save both templates

    What happens

    Always when I open the Template1dotm Word shows me this error and I cannot see any code in VBE.

     

    If I remove the Ribbon code (yes, the 2 lines of XML code), it works correctly. Unfortunatelly I have to have my ribbon. There are many buttons.

    What do you think I should do?

    Thanks Pat


    Visual Studio 2010 Professional, Office 2007
    • Moved by Max Meng Wednesday, April 13, 2011 6:07 AM (From:Word IT Pro Discussions)
    Tuesday, April 12, 2011 9:06 AM

Answers

  • Hi

    just for your information. I couldn't fix it on my project via VBA so I wrote a small dll to avoiding referencing to the templates.

    It helped me to solve the issue with ribbon or rather with "Invalid data format" error.


    Visual Studio 2010 Professional, Office 2007
    • Marked as answer by PetLahev Thursday, April 14, 2011 9:31 AM
    Thursday, April 14, 2011 9:31 AM