How to replicate:
1. Download the solution below
2. Restore packages and build
3. Start the application (NOTE this will add an addon on your PowerPoint)
4. Open the presentation file attached below
5. Press the "Press Me" button on at the home ribbon
6. You should see a new inserted slide there. Notice that it's background is white.
7. Close Powerpoint
7. Now change the solution's Spire version to 4.3.9.
8. Rebuild.
9. Start application.
10. Open the presentation file attached below.
11. Press the "Press Me" button
12. You should see a new inserted slide with the correct Red background.
Here's the code I'm using in case you are not comfortable with running the solution
- Code: Select all
private void Button1_Click(object sender, RibbonControlEventArgs e)
{
var preStream = new MemoryStream(Resource1.missingbg);
preStream.Seek(0, SeekOrigin.Begin);
var tmpPptxPath = Path.GetTempFileName();
using (var spirePresentation = new Presentation(preStream, FileFormat.Auto))
{
spirePresentation.SaveToFile(tmpPptxPath, FileFormat.Auto);
}
var currentComSlide = new List<IP.Slide> { Globals.ThisAddIn.Application.ActiveWindow.Selection.SlideRange[1] }.FirstOrDefault();
var pre = (IP.Presentation)currentComSlide.Parent;
pre.Slides.InsertFromFile(tmpPptxPath, 1);
}