1
votes

team!

I have a MS Powerpoint add-in project in my Visual Studio 2008, in C#. I use the following code to read the text of the footer from a Powerpoint presentation:

String currentFooterText = 
Application.ActivePresentation.SlideMaster.HeadersFooters.Footer.Text;

(where Application class comes from the namespace Microsoft.Office.Interop.PowerPoint.Application)

When I load a ppt file (97-2003 Presentation type), the code is able to access the text that was inserted in the Footer property of the Slide (menu View > Head and Footer... > Slide > Footer).

But, when I load a pptx file (Presentation created in Powerpoint 2007 or 2010), the code is not able to access the text that was also inserted in the Footer property of the Slide (menu Insert > Head and Footer... > Slide > Footer). The Text returns a blank text.

Please, does anyone have any idea about that? Is there any incompatibility between these Powerpoint versions for footer access?


Steve!

Thanks for the reply!

In fact, my code is on Visual Studio 2008, for a Powerpoint 2003 Add-in project. And the problem happens when I open a pptx file.

I tried your suggestion, but with brackets instead of the parenthesis, like below:

String s = Application.ActivePresentation.Designs[1].SlideMaster.HeadersFooters.Footer.Text;

But the problem persists, the Text still returns empty for pptx files. It works for ppt, like before. Do you know any programmatic way to use on VS 2008, for a Powerpoint 2003 Add-in project, to access the footer text of a pptx file?

Thank you!

1

1 Answers

0
votes

Is there any incompatibility between these Powerpoint versions for footer access?

Yes. In 2007/2010/2013, you'd use:

ActivePresentation.Designs(1).SlideMaster.HeadersFooters.Footer.Text

(Assuming that you want the footer from the first slide master; there can be more than one, as in fact there can be in PPT 2002 and onward)