Quantcast
Channel: Open XML Format SDK forum
Viewing all articles
Browse latest Browse all 1288

Adding a picture to a document that already has picture

$
0
0

I'm trying to add a picture (with an external relationship) to a document. It works fine if the document is blank, but if there are already pictures in the document, then I get the following exception:

"Only one instance of this type is allowed for this parent."

The line that throws it is this one:

 DrawingsPart drawingsPart1 = UriPartDictionary["/xl/worksheets/sheet1.xml"].AddNewPart<DrawingsPart>("imgId1");

That's before I've added any external relationships. Why can you only have one DrawingsPart for an OpenXmlPart?

Thanks for any help


Viewing all articles
Browse latest Browse all 1288

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>