Free Support Forum - aspose.com

How can i change the layout of the particual slide in the presentation

Hi

I have a presenation which contain some slides say 10 slide. All these slide only contain images. Now i want to change the layout of the slide to OnlyTitlePlaceholder and wants to add titles to it using textholder and placeholder. Is there any way to change the layout of the slide on the fly? I tried few things but it doesn't work. My sample code is as below

Presentation pres = new Presentation("C:\test.ppt");

int page = 1;

Slide slidee = null;

while ((slidee = pres.GetSlideByPosition(page++)) != null)

{

slidee.Layout = SlideLayout.OnlyTitlePlaceholder;

if (slidee.Placeholders[0] != null)

{

TextHolder th;// = new TextHolder();

th = (TextHolder)slidee.Placeholders[0];

th.Paragraphs[0].Portions[0].Text = "Title PlaceHolder";

}

}

Earliest reponse will be great help.

Thanks in Advance

ReadyToHelp

Dear ready,

I have checked, layout is not changing, but I will investigate it further and let you know.

Hi msfaiz

Thanks for the reply. Well as per Aspose doucmentation we can set the layout of the slide, but as you tested too its not working. So Please investigate the feature and let us know whether we can change the layout of the slide or not, as my work got stuck because of this.

Hope to receive an early response.

Thanks in Advance

ReadyToHelp

Yes, I have also tested it; it is not working, so I have requested technical team to look into issue. I will let you know what they say as early as possible.

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

However, in your case, you can simply add a TextFrame and set its formatting and font as you like.

For code example, please see this.

http://www.aspose.com/community/forums/thread/122846/adding-title-with-textframe.aspx

Thank You

Hi msfaiz

Is there any progress related with this issue?

Thank you

readytohelp

We found out that slide layout cannot be changed, so we have set the Slide.Layout property as read-only.