Error if docx file contains Content Controls

Feb 2, 2009 at 6:12 AM
Edited Feb 2, 2009 at 6:15 AM
Hi,

Great stuff - this is just what I have been looking for.

However, if a docx file contains Content Controls if the XAML conversion fails with the error:

---------------------------
'Normal' dictionary key is already used. Key attributes must be unique. Line '1' Position '2246'.
---------------------------

Running the code the error occurs at:
System.Windows.Markup.XamlParseException occurred
  Message="'Normal' dictionary key is already used. Key attributes must be unique. Line '1' Position '1462'."
  Source="PresentationFramework"
  LineNumber=1
  LinePosition=1462
  StackTrace:
       at System.Windows.Markup.XamlReaderHelper.Read(XamlNode& xamlNode)
       at System.Windows.Markup.XamlParser.ReadXaml(Boolean singleRecordMode)
       at System.Windows.Markup.TreeBuilderXamlTranslator._Parse()
       at System.Windows.Markup.XamlParser.Parse()
       at System.Windows.Markup.XamlTreeBuilder.ParseFragment()
       at System.Windows.Markup.TreeBuilder.Parse()
       at System.Windows.Markup.XamlReader.XmlTreeBuildDefault(ParserContext pc, XmlReader reader, Boolean wrapWithMarkupCompatReader, XamlParseMode parseMode, Boolean etwTracingEnabled)
       at System.Windows.Markup.XamlReader.Load(XmlReader reader)
  InnerException:



Not sure why this is happening, but looking at the XAML being generated the above error is occuring in the Styles, with the Normal style being duplicated as soon as you add a Content Control to the docx file and try to export to XAML.

If you can fix this then I will be a happy man, as the documents I want to use this XAML feature with use Content Controls extensively.

Cheers,
Murray

Coordinator
Feb 2, 2009 at 6:37 AM
Please create an issue in the Issue Tracker tab with a test file attached that demonstrates the problem.
Feb 2, 2009 at 7:54 AM
Done:
http://www.codeplex.com/Word2007ToXaml/WorkItem/View.aspx?WorkItemId=1522

Thanks,
Murray