Cannot Locate DocumentFormat.OpenXml.Office2010.Word.DrawingShape Namespace in Open XML SDK 2.0 for Microsoft Office

StackOverflow https://stackoverflow.com/questions/20955013

  •  24-09-2022
  •  | 
  •  

質問

According to the documentation for Open XML SDK 2.0 for Microsoft Office I should be able to use DocumentFormat.OpenXml.Office2010.Word.DrawingShape (along with many other namespaces prefixed by DocumentFormat.OpenXml.Office2010) with my Word 2010 document.

I have referenced assembly DocumentFormat.OpenXml (from DocumentFormat.OpenXml.dll which is version 2.0 of the SDK) but Object Browser does not show any of the DocumentFormat.OpenXml.Office2010 etc namespaces as available.

If I reference Open XML SDK 2.5 for Microsoft Office however, these namespaces are available. Unfortunately, I need to use v2.0 in my project because we rely on a third party dll which is not compatible with framework 4.

Am I wrong to think that everything should be contained in DocumentFormat.OpenXml.dll (for v2.0) or is there an additional package I need to download?

役に立ちましたか?

解決

It would appear that Microsoft have sneaked in at least one update since I originally downloaded the SDK. The version of the dll I was using was 2.0.4330.0 but after discussion with Cindy Meister on an MSDN forum I discovered that there is (at least one) newer version.

I downloaded the SDK again (my original download was probably a couple of years ago) and the version downloaded (v2.0.5022.0) magically contained the required namespaces.

I hope this helps someone as it's taken a ridiculous amount of time to sort this out.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top