We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to find the title of a slide?

Thread ID:

Created:

Updated:

Platform:

Replies:

127024 Oct 21,2016 07:57 AM Oct 25,2016 12:14 AM Windows Forms 3
loading
Tags: Presentation
Klaas Brant
Asked On October 21, 2016 07:57 AM

I want to use the presentation component to create a table of content of all slides in the presentation. Up to now I have used a poerpoint macro for this where I retrieve the title of the slide (as entered under powerpoint in the title box). Here is a snippet of the VBA macro:

On Error Resume Next  ' in case there's no title placeholder on the slide
For Each oSlide In ActiveWindow.Presentation.Slides
    strTitles = strTitles _
        & "#####." _
        & CStr(oSlide.SlideIndex) _
        & "  - " & oSlide.Shapes.Title.TextFrame.TextRange.Text _
        & vbCrLf
Next oSlide

As you can see in VBA the shape has a title attribute which holds the slide title.
Although IShape has a title attribute it seldom has the slide title. It is 99% empty. I have see that in powerpoint 2016 the title shape name starts with "Title" but this is not the case in older version (and the VBA code works ok for older versions). Long story for the question: how to retrieve the slide title (what ppt called the title from the title textbox/shape).

I have added a test pptm file with the complete macro

BTW: the component rejects .PPTM files (which is just a PPTX with VBA macros in it). Maybe in the next release.
Would also love to have to the recorded audio of the slide (to be able to detach it).


Attachment: ppt_titles_9dd150f7.zip

Arun Prasad Matheshwaran [Syncfusion]
Replied On October 24, 2016 07:59 AM

Hi Klaas Brant, 
Thanks for your update. 
Query 
Response 

I want to use the presentation component to create a table of content of all slides in the presentation. Up to now I have used a PowerPoint macro for this where I retrieve the title of the slide (as entered under PowerPoint in the title box). Here is a snippet of the VBA macro:  

  

On Error Resume Next  ' in case there's no title placeholder on the slide 

For Each oSlide In ActiveWindow.Presentation.Slides 

    strTitles = strTitles _ 

        & "#." _ 

        & CStr(oSlide.SlideIndex) _ 

        & "  - " & oSlide.Shapes.Title.TextFrame.TextRange.Text _ 

        & vbCrLf 

Next oSlide 

  

As you can see in VBA the shape has a title attribute which holds the slide title. 

Although IShape has a title attribute it seldom has the slide title. It is 99% empty. I have see that in PowerPoint 2016 the title shape name starts with "Title" but this is not the case in older version (and the VBA code works ok for older versions). Long story for the question: how to retrieve the slide title (what ppt called the title from the title textbox/shape). 

  

I have added a test pptm file with the complete macro 

We have created a simple Windows Form sample to create table of contents of all slides in a presentation by using the "Title Placeholder". Please follow the below sample attached and let us know whether it could satisfy your requirement. 

Sample: 

 http://www.syncfusion.com/downloads/support/forum/127024/ze/TableOfContents1672454064 

 

BTW: the component rejects .PPTM files (which is just a PPTX with VBA macros in it). Maybe in the next release.  

We could see that you have created a separate incident for these queries, please follow up with those incidents for further updates. 

Would also love to have to the recorded audio of the slide (to be able to detach it). 


Please let us know if you need any further clarifications regarding this, 

Regards, 
Arun 


Klaas Brant
Replied On October 24, 2016 08:26 AM

Works like a charm. Thanks for the sample! Really helpful.

Greetings,
KB

Devisri Jothi [Syncfusion]
Replied On October 25, 2016 12:14 AM

Hi Klaas, 
We are glad that the provided sample was helpful, please let us know if you need any further assistance. 
Thanks, 
Devisri 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;