Skip to content

Exception with SmartArt diagrams #1840

Closed
@manfromarce

Description

Describe the bug
It seems that few DOCX files can also have the application/vnd.openxmlformats-officedocument.drawingml.diagramDrawing+xml content type for SmartArt diagrams. I don't know if this is allowed in the specification, Word and other editors can open them properly but the Open XML SDK throws the following exception:

The document cannot be opened because there is an invalid part with an unexpected content type.
[Part Uri=/word/diagrams/drawing1.xml],
[Content Type=application/vnd.openxmlformats-officedocument.drawingml.diagramDrawing+xml],
[Expected Content Type=application/vnd.ms-office.drawingml.diagramDrawing+xml]

To Reproduce
Build and run this sample (a DOCX file which causes the issue is included): ConsoleApp1.zip

Observed behavior
An DocumentFormat.OpenXml.Packaging.OpenXmlPackageException is thrown.

Desktop (please complete the following information):

  • OS: Windows
  • Office version [e.g. 16.0.15427.20178]
  • .NET Target: .NET 8
  • DocumentFormat.OpenXml Version: 3.2.0

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions