0

I am using Open XML SDK 2.0 Productivity Tool to reflect the code of an empty PowerPoint 2010 presentation. I copied the generated code to a .cs file in a project which has a reference to DocumentFormat.OpenXml.dll (v2.0.5022.0). When I compile the project, some errors appear:

Scene3D does not exist in the namespace 'DocumentFormat.OpenXml.Drawing'
TextAlignValues does not exist in the namespace 'DocumentFormat.OpenXml.Drawing'
TextAnchoringValues does not exist in the namespace 'DocumentFormat.OpenXml.Drawing'

It seems that the Productivity Tool is generating code that references types that are not in the OpenXML namespace despite I just downloaded the whole pack from the Microsoft site:

http://www.microsoft.com/en-us/download/details.aspx?id=5124

In the other hand, MSDN documentation states that Scene3D class belongs to a different namespace: DocumentFormat.OpenXml.Drawing.Diagrams and TextAlignValues and TextAnchoringValues are replaced by TextAlignTypeValues and TextAnchoringTypeValues.

What is wrong? Is the code reflector generating wrong code or my references to OpenXML dll are bad? How should I correct this?

Yván Ecarri
  • 1,661
  • 18
  • 39
  • I don't think your the code generated by Productivity Tool is wrong, but you have some *import* statement (or *using* in C#) that can make troubles. I have also some troubles in some projects when a class with the same name is present in many namespaces, as you noticed for *Scene3D*. If you have some references in conflict, you should identify them and set the full name of the concerned object (ie: DocumentFormat.OpenXml.Drawing.Diagrams.Scene3D instead of Scene3D for example). – Chris Jul 09 '13 at 10:25
  • @Chris: Thank you for the comment. OpenXML SDK PT generates aliases for the namespaces it uses. For example: `using A=DocumentFormat.OpenXml.Drawing;` and then refers to `A.Scene3D`. The problem is that Scene3D belongs to `A.Diagrams` instead of `A`. – Yván Ecarri Jul 09 '13 at 11:01
  • You mean that the generated code uses *A.scene3D*? If it works with A.diagrams.scene3D, it could be a bug in OpenXml SDK PT. – Chris Jul 09 '13 at 11:29
  • @Chris: Yes, it works with A.Diagrams.Scene3D :( – Yván Ecarri Jul 09 '13 at 12:15

0 Answers0