PowerPoint Names and Tags


#1

Does the Aspose API have any way to access PowerPoint object names? In the PowerPoint Programmers API - each slide, shape, etc. have a name associated with them. Sometimes these feilds are used for classification behind the scenses or could be used in a PowerPoint template to tag items for replacement. Does Aspose allow you to read or modify theses values?

The PowerPoint API allows you to assign name/value pairs to a Slide using the "Tags" collection. Is there anyway to access these name value pairs in Aspose?


#2

PPT file doesn’t contain name of objects. MS PowerPoint generates it dinamically.

“Tags” collection is supported. Please check Slide.Tags and Shape.Tags properties.


#3

I see the "Tags" collection documented on your website in the API; however, it is not available in the demo that I downloaded and am evaluating.

Since you claim on your website that the demo version contains the full functionality of the retail version, I am confused as to why it does not show up. I have attampted to attached the aspose.powerpoint.dll, which you can add to a project reference in Visual Studio and view it in the Object Browser...no Tags collection is visible on the slide or shape objects.

Am I evaluating a old copy? or can you point me in the right direction to get access to this collection?


#4

I thought Tags collection is very simple and clear to use even without large examples.

It almost the same as in MS PowerPoint VB API. What examples you prefer VB or C#?



Example for Slide.Tags:

pres.GetSlideByPosition(1).Tags.Clear();

pres.GetSlideByPosition(1).Tags.Add(“test_tag”, “value”);

string name = pres.GetSlideByPosition(1).Tags.GetTagName(0); // returns “test_tag”

string val = pres.GetSlideByPosition(1).Tags[“test_tag”]; // returns “value”

pres.GetSlideByPosition(1).Tags.Remove(“test_tag”);



And the same for Shape:

shape.Tags.Clear();

shape.Tags.Add(“test_tag”, “value”);

string name = shape.Tags.GetTagName(0); // returns “test_tag”

string val = shape.Tags[“test_tag”]; // returns “value”

shape.Tags.Remove(“test_tag”);



#5

Sorry - apparently I was using an old dll where the Tags collection had not yet been implemented. I downloaded the newest stuff and now it appears that I have access to everything documented in the API.

As a follow up to the "Name" property on various PowerPoint objects. You mentioned that these are auto-generated; however, my company has many existing powerpoints where (using a custom in-house addin) they have changed the names on various PowerPoint objects - the most common practice is to change the slide name: so instead of "slide1" it has "successstoryslide1". These names do persist - meaning I can close the file (and/or application) and re-open the file again and the updated names are there. If they were auto-generated everytime, I would expect to loose these changes so I must conclude that they are stored somewhere in the file. Is there any chance that access to this field will be available in the future?


#6

Names of slides after ditrect changing were implemented. Please check Slide.Name property.

For shapes it’s necessary to investigate such possibility.


#7

Thanks for pointing out the Slide.Name - I did not see it before probably for the same reason as the Tags collection (old version). Keep me updated should you add the Shape.Name functionality.

Thanks for the quick responses!