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

Free Support Forum - aspose.com

How to add a new slide of type Aspose.Slides.Pptx.SlideLayoutTypeEx.Title

I have the most simple problem to which I cannot find a solution from any help file, demo or forum post.


I need to create new slide to the presentation. The new slide would need to have the title element in place (the SlideLayoutTypeEx = Title).
I can create completely empty new slides with commands (this is in vb):
            Dim pres1 As Aspose.Slides.Pptx.PresentationEx
pres1 = New Aspose.Slides.Pptx.PresentationEx(“c:\example.pptx”)
Dim slide1 As Aspose.Slides.Pptx.SlideEx
slide1 = pres1.Slides(pres1.Slides.AddEmptySlide(pres1.LayoutSlides(0)))
As the users can change the slide template themselves I have no knowledge what number of the LayoutSlides is the one that i would like to use - the number 0 seems always be the empty slide layout?
Could you please provide me a sample code how to add a slide with title to an existing presentation?
Br, Antti

Hi Antti,

I regret to share that LayoutSlides are not currently supported in Aspose.Slides. An issue with ID 17205 has already been created in our issue tracking system to provide this feature. This thread has also been linked with the issue so that you may be automatically notified once the feature is available. For the time being, one may either use template presentations and clone desired slide of particular layout in your target presentation. At the moment, one can add empty slides through Aspose.Slides. He can later on add title shape using AutoShapeEx by him self.

Thanks and Regards,

Hi
Sorry for posting into an old thread but:
How do you add a Title shape on the slide?

If I understand correctly there is PlaceholderEx property in ShapeEx, and PlaceholderEx.Type should be PlaceholderTypeEx.Title.

But PlaceholderEx is a read-only property. This means code like this does not work:
AutoShapeEx title = (AutoShapeEx)s.Shapes[s.Shapes.AddAutoShape(ShapeTypeEx.Rectangle, 50, 50, 50, 50)];
title.AddPlaceholder(new PlaceholderEx());
title.Placeholder.Type = PlaceholderTypeEx.Title;

So how do you change a normal rectangle to a title shape?
This is important becaus the content of a Title shape appear in the Outlide sidebar in Powerpoint

BR
Olavi

Hi Olavi,


I regret to share that the support for adding Placeholder is unavailable using Aspose.Slides. However, the read only support for existing placeholder that has been added by PowerPoint is available using Aspose.Slides. An issue with ID 33102 has been created in our issue tracking system as new feature request to investigate the possibility of implementing the feature. This thread has been linked with the issue so that you may be automatically notified once the issue is resolved.

I also like to share that you can format the rectangle shape exactly as the title shape and then using AlternativeText property to name the rectangle using user defined name. You may then identify the shape on the basis of that. Second option is to clone a template slide created using PowerPoint with Title placeholder and then use that for your purpose. Please share, if I may help you further.

Many Thanks,