4

I have created simple shape in a slide now i want to save these save into category and display in custom task pane

Currently i have tracked selected shape but not getting idea how to save and show in custom task pane Code:

//Microsoft.Office.Interop.PowerPoint;
        PowerPoint.Slide currentSlide = Globals.ThisAddIn.Application.ActiveWindow.View.Slide;
                    if (currentSlide != null)
                    {
                        var selection = Globals.ThisAddIn.Application.ActiveWindow.Selection;

                        if (selection.ShapeRange != null)
                        {
                            var shapecount = selection.ShapeRange.Count;

                            if (shapecount > 0)
                            {
                                for (int i = 1; i <= shapecount; i++)
                                {
                                    var shape = selection.ShapeRange[i];

                                    //want to save and load shape in Custom task pane  for later use.
                                }
                            }
                        }

                    }

I have used Microsoft.Office.Interop.PowerPoint namespace and want to load and save so formed shape in slide

Angel Koh
  • 12,479
  • 7
  • 64
  • 91

1 Answers1

1

The PowerPoint object model doesn't provide any method for serializing shapes. You can get the shape property values and store them using the XML or JSON format. So, then you will be able to add the a new shape to the slide and set properties to the saved values. Hope it makes sense for you!

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45