Share via

Custom XML data in SlideMaster

Anonymous
2012-01-26T10:33:16+00:00

Hi all,

I have a rather puzzling question.

I am creating a PPT-template, and I want to store some Custom XML data in it. Not only in the template, but actually on each slide.

Inserting the data in the template works just fine; something like

Set oSlideLayout = ActivePresentation.SlideMaster.CustomLayouts(n)

Set shp = oSlideLayout.Shapes(i)

Set xmlPart = shp.CustomerData.Add

customerDataId = xmlPart.Id

xmlPart.LoadXML "<XMLData date='20120126' id='something'>TEXT</XMLData>"

If I look up all the added XML-parts in the SlideMaster / CustomLayouts, I can find them all.

Puzzling part: when I look in the presentation itself, and apply the desired customlayout, I'm not able to retreive any XML data as stored in the template.

I want this for automatisation purposes, so from code on a presentation can be generated and altered after users have messed up that presentation.

As I understood, when copying a shape, the customer XML part is included with the new shape, but does that mean it doesn't work from applying templates?

Hope someone can help me on this one.

Greetz,

Bert

Microsoft 365 and Office | PowerPoint | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Steve Rindsberg 99,166 Reputation points MVP Volunteer Moderator
2012-01-26T16:29:28+00:00

To add a bit to Shyam's reply:

If you create a new presentation based on a template, it's more or less the same as opening the template AS a presentation and then saving a new copy of it.  Any slides, VBA or other presentation contents are included in the new presentation.

If on the other hand you APPLY a template to an existing presentation, none of the content of the template is added to the presentation, just the formatting.

If you simply need to store your own data in the presentation, on slides or on specific shapes, Tags might do the job.

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2012-01-26T15:54:35+00:00

    Hi,

    I may be wrong here since I have worked very little with the CustomData object. But my experience with templates is that when a template is applied it is pretty much is scrubbed clean so could explain why the CustomerData is not coming thru.

    Was this answer helpful?

    0 comments No comments