Search code examples
openxmlopenxml-sdk

What does the "id" of "a16:creationId" mean for charts in OpenXML?


BACKGROUND
When creating charts on a slide in PowerPoint, I get different values for the id attribute of the a16:creationId tag. I assume it somehow specifies the type of chart, but I don't know.

Here are two examples of the file ppt/slides/slide1.xml from two different PowerPoint files, one containing a Column-Chart and one containing a Line-Chart.

The creationId-tag of the Column-chart looks like this:

<a16:creationId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main"
                id="{7558BA7B-B88C-9882-784A-C7347E5D16B6}" />

And the creationId-tag of the Line-chart looks like this:

<a16:creationId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main"
                id="{5B92A92D-3C7B-B1D7-60F7-7F2193D93260}" />

Here is some more context from the two xml files.

The Column-Chart:

<p:cNvPr id="2" name="Chart 1">
    <a:extLst>
        <a:ext uri="{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}">
            <a16:creationId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main"
                            id="{7558BA7B-B88C-9882-784A-C7347E5D16B6}" />
        </a:ext>
    </a:extLst>
</p:cNvPr>

The Line-Chart:

<p:cNvPr id="2" name="Chart 1">
    <a:extLst>
        <a:ext uri="{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}">
            <a16:creationId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main"
                            id="{5B92A92D-3C7B-B1D7-60F7-7F2193D93260}" />
        </a:ext>
    </a:extLst>
</p:cNvPr>

QUESTION
I tried to search for the id's using different search engines, and I searched all the files of the OpenXML specification for the id's, but didn't find anything.

What do the id's mean and where do I find a description of the id's?


Solution

  • It's just a unique ID for the shape (chart, autoshape, table, etc.) that Office 2016 and later creates for all shapes (slides have this unique ID too). The spec says it has to be a Guid. You can replace the auto-generated one with your own guid if you like.

    The benefit is that you can query all slides for a specific shape based on its creationId (think corporate logo in a slide master that needs to get replaced programmatically across 500 decks - knowing the logo's id from creationId makes find/replace trivial).