You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
@manfromarce, I verified that application/vnd.ms-office.drawingml.diagramDrawing+xml should be valid according to [MS-ODRAWXML] 2.1.3 Diagram Layout which also has the following behavior note:
<3> Section 2.1.3: The Diagram Layout extension is also present in Microsoft Office 2007 Service
Pack 2 (SP2).
It is not listed in the ISO 29500-1 standard, it is an extension part in MS-ODRAWXML and therefore this should be the correct content type for a drawing part with the relationship http://schemas.microsoft.com/office/2007/relationships/diagramDrawing
If I create a diagram in Word latest version, I get this for the drawing part:
I've also checked our Office source and vnd.openxmlformats-officedocument.drawingml.diagramDrawing+xml doesn't show up in the history anywhere so I'm thinking that this probably occurs in other document generators.
I'll close this issue for now.
@manfromarce if you can reproduce this with a specific version of Word them please feel free to comment here and we'll investigate.
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:
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):
The text was updated successfully, but these errors were encountered: