Have a PPTX template created with Microsoft Powerpoint and want to add shapes to this template. Seems like copying a shape in MS PP does not create a recognizable shape in Aspose. So I wonder which way is the right way of createing shapes in MS PP?
Hi Bo Ander,
Ok, you misunderstood me a bit: I’m trying to add shapes to the template with Microsoft Powerpoint but it seems like Aspose does not recognize them as shapes. Only if I select a predefined layout then Aspose recognize the shapes but not when I have a slida and copy the shape to a new shape in MS powerpoint (e.g. in my template). I possibly misunderstand the “shape definition”?
Hi Bo Ander,
First slide created by copying the shape (copied shape does not work, not found in the loop below) and the second slide is a defautl PPT layout which works
Code extract:
Public Function runPowerPointReport(ByRef PPTReport As PresentationEx…
…
Dim shp As ShapeEx
Dim shpIndex As Integer = 0
Dim sldShpCount As Integer = 0
Try
For Each sld As SlideEx In PPTReport.Slides
sldShpCount = sld.Shapes.Count
For shpIndex = 0 To sldShpCount - 1
shp = sld.Shapes(shpIndex)
If shp.Placeholder IsNot Nothing Then
tstr = CType(shp, AutoShapeEx).TextFrame.Text
…
Hi Bo Ander,
Public Sub FindShapes()Dim path As String = “C:\Users\Mudassir\Downloads”Dim pres As PresentationEx = New PresentationEx(path + “ShapeQuestion.pptx”)Dim shp As ShapeExDim tstr As StringFor Each slide As SlideEx In pres.SlidesDim shpIndex As Integer = 0Dim sldShpCount As Integer = 0sldShpCount = slide.Shapes.CountConsole.WriteLine("Shape Count: " + sldShpCount.ToString())For shpIndex = 0 To sldShpCount - 1shp = slide.Shapes(shpIndex)Dim ashp As AutoShapeEx = CType(shp, AutoShapeEx)tstr = ashp.TextFrame.TextConsole.WriteLine("Shape : " + shpIndex.ToString() + " : " + tstr)NextNextEnd Sub