2
votes

Is it valid to use an altChunk element within a any of the slide xml files within a pptx ooxml package?

I have read through the ECMA-376 spec, and while altChunk is defined within the WordprocessingML section of the spec (e.g.: "Any document part that permits a p element can also contain an altChunk element, whose id attribute refers to a relationship"), it is not mentioned anywhere else.

PresentationML apparently doesn't have a p element, and the other valid parent elements for AltChunk (body (§17.2.2); comment (§17.13.4.2); docPartBody (§17.12.6); endnote (§17.11.2); footnote (§17.11.10); ftr (§17.10.3); hdr (§17.10.4); tc (§17.4.66)) don't appear to be valid within PresentationML.

My attempts to use altChunk within a slide xml file (with proper validated entries in the relevant rels file) have resulted in invalid xml: PPT2010 offers to repair the file, and this great tool http://www.probatron.org:8080/officeotron/officeotron.html offers a number of different errors (e.g.: "Invalid content was found starting with element 'p:altChunk'." or "One of '{"http://schemas.openxmlformats.org/drawingml/2006/main":p}' is expected") depending on where I place the altChunk element.

(FWIW, the actual problem I am trying to solve is to include some basic HTML within a ppt slide.)

1

1 Answers

0
votes

What do you want to accomplish by including the HTML within a slide?

If you simply need to store it (or any other text) you can use Tags. I don't know how they're implemented in XML but you can add one via a bit of VBA and see what appears in the XML:

Sub AddTagToSlide()
With ActivePresentation.Slides(1)
  .Tags.Add "ThisIsTheTagName", "ThisIsTheTagValue"
End With

' Did it work?  How do we retrieve a tag?
With ActivePresentation.Slides(1)
  MsgBox .Tags("ThisIsTheTagName")
End With
End Sub

You can add as many tags as you like to the Presentation object, Slide objects, and Shape objects, among other things. There's no UI for tags, so they're not visible to users.