Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception with SmartArt diagrams #1840

Open
manfromarce opened this issue Nov 24, 2024 · 0 comments
Open

Exception with SmartArt diagrams #1840

manfromarce opened this issue Nov 24, 2024 · 0 comments

Comments

@manfromarce
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant