We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Shape ID


We are using Aspose Slides for java version 17.3.

To distinguish the shapes within a slide in ppt we use shape Id. In our Authoring clients we use Microsoft’s Shape.Id Property (PowerPoint) as shown in the link: https://docs.microsoft.com/en-us/office/vba/api/PowerPoint.Shape.Id

However, when we construct the Presentation object of the pptx file using Apose Slides, the shape Id is not the same as was set by the Microsoft API.

For example, in the attached pptx file - for the shape named “VideoShape”, Shape.Id property set by Microsoft is “4” whereas the shape id provide by Aspose for the same shape is “2”.

Following is the code snippet being used to get the shape Id:

Presentation presentation = new Presentation(“C:/temp/ShapeIdIssue.pptx”);

IShapeCollection iShapeCollection = presentation.getSlideById(256).getShapes();

for (int i = 0; i < iShapeCollection.size(); i++) {

long id =iShapeCollection.get_Item(i).getUniqueId();

String name =iShapeCollection.get_Item(i).getName();

System.out.println(id+ " " +name);


Please let me know how I can get the shape Id property set by Microsoft using Aspose library.



Hi Neeraj,

I have observed your comments. Can you please share the similar working code for Microsoft code as well for comparison. Please share code so that we can further proceed to investigate issue in details.

Best Regards,
Following is the C# code snippet being used:

String filePath = "C:\\temp\\ShapeIdIssue.pptx";
int slideId = 256;
Microsoft.Office.Interop.PowerPoint.Application application = new Microsoft.Office.Interop.PowerPoint.Application();
Presentation presentation = application.Presentations.Open(filePath, Microsoft.Office.Core.MsoTriState.msoFalse);
foreach (Slide slide in presentation.Slides)
if (slide.SlideID == slideId)
foreach (Shape shape in slide.Shapes)
Console.WriteLine(" "+shape.Id+" "+shape.Name);

Output using Aspose library:
0 Title
1 Subtitle
2 VideoShape

Output using .Net
2 Title
3 Subtitle
4 VideoShape


Hi Neeraj,

I have observed your comments. A ticket with ID SLIDESJAVA-36208 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with issue so that you may be automatically notified once issue will be fixed.

We are sorry for your inconvenience,


Can you please let me know if there is any progress on this?

This issue is hindering our development for one of the core features in our product. Since this is the first step towards what we are going to achieve we are stuck up and cannot move forward in the development.
I would appreciate if you can quickly provide some other means or workaround (if not fix) to match the shape using the API provided by Aspose so that we can move forward in the development.


Hi Neeraj,

I have observed the issue status from our issue tracking system and regret to share that the concerned issue has recently been created and is pending for investigation by our product team at the moment. We will be able to share further feedback, once our product team will schedule and investigate the issue.

As a workaround for the moment, I suggest you to please try exploring Shape.setAlternativeText(String st) and Shape.getAlternativeText() methods that helps you in setting and getting the user defined names for shapes. You can also set the alternative text property for the shape in PowerPoint as well. For more details, please visit this documentation link. I hope this will be helpful.

Best Regards,