PowerPoint Presentations with ThemeOverride parts
- This topic has 1 reply, 1 voice, and was last updated 9 years, 2 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
Home › Forums › Open-Xml-PowerTools › PowerPoint Presentations with ThemeOverride parts
Tagged: Open-XML-PowerTool, ThemeOverride
I believe I’ve fixed the issue by adding the code listed below at the end of CopyChartObjects function in the OpenXmlPowerTools PresentationBuilder.cs:
private static void CopyChartObjects(ChartPart oldChart, ChartPart newChart)
{
……………………………………………………………..
foreach (var oldTop in oldChart.Parts.Where(p => p.OpenXmlPart.ContentType == “application/vnd.openxmlformats-officedocument.themeOverride+xml”))
{
var newId = “R” + Guid.NewGuid().ToString().Replace(“-“, “”).Substring(0, 16);
ThemeOverridePart newTop = newChart.AddNewPart<ThemeOverridePart>(“application/vnd.openxmlformats-officedocument.themeOverride+xml”, newId);
newTop.FeedData(oldTop.OpenXmlPart.GetStream());
newChart.CreateRelationshipToPart(newTop, newId);
}
}
It works for me, but please correct me if I’m doing something wrong.
Thanks!