Free Support Forum - aspose.com

Access to Footer on master slide

I have created a template presentation which is attached. In the header / footer of the master slide of the presentation I have some items. Specifically, I have a footer item which I want to access from my application and set the text value for. I have attempted to use the following code:

iobj_Presentation = New Aspose.Slides.Presentation(iobj_Server.MapPath("Templates\Publish\GATSBase.ppt"))

If Not paobj_GridFootnotes Is Nothing Then
iobj_Presentation.Masters(0).HeaderFooter.FooterText = paobj_GridFootnotes(0)
End If

When I do this I receive the following error message:
Source 1: Aspose.Slides
Error 1: Object reference not set to an instance of an object.

Stack Trace:
at Aspose.Slides.HeaderFooter.༮() at Aspose.Slides.HeaderFooter.set_FooterText(String value) at PublishClass.ProcessPowerPoint(GridView[] paobj_GridView, Chart[] paobj_ChartControl, String[] paobj_GridFootnotes) in C:\VS 2005 Projects\Projects\GATS New Solution\GATS Web Site\App_Code\PublishClass.vb:line 278 at PublishClass.PublishPage(ePublishFormat pe_PublishFormat, String ps_PublishOption, GridView[] paobj_GridView, String[] pa_SelectedRowNumberFromGridView, GATSCriteria[] paobj_Criteria, Chart[] paobj_ChartControl, String[,] pa_ChartTitle, String[] pa_LeftAxisTitle, String[] pa_LeftAxisStatType, String[] pa_LeftAxisChartType, String[] pa_RightAxisTitle, String[] pa_RightAxisStatType, String[] pa_RightAxisChartType, String ps_RawHTML, String[] paobj_GridFootnotes) in C:\VS 2005 Projects\Projects\GATS New Solution\GATS Web Site\App_Code\PublishClass.vb:line 221 at AdvancedQuery.PublishFromMasterPage(Object sender, CommandEventArgs e) in C:\VS 2005 Projects\Projects\GATS New Solution\GATS Web Site\AdvancedQuery.aspx.vb:line 149

Any assistance would be apprecaited.

Any assistance on this item would be greatly appreciated.

Dear George,

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

Thanks for considering Aspose.Slides.

You can set the HeaderFooter properties of indvidual slides using Slide.HeaderFooter property. e.g to show footer text or page number , the code will look like this

sld.HeaderFooter.IsPageNumberVisible = true

sld.HeaderFooter.IsFooterVisible = true

sld.HeaderFooter.FooterText=”Footer”

But if you want to set the footer text in Master Slides, then you should see this thread.

http://www.aspose.com/community/forums/thread/131948/add-text-and-logo-in-slides-power-point.aspx

@shakeel.faiz,
Please tell me about how to access a master slide and made changes in the footer text for different type of slides in pptx c#?
Example:Access a master slide,access a title slide,access blank slide.

@Boopathi_Palanisamy,

I suggest you to please use the following sample code on your end to access the Master slide and concerned Layout slide footers and setting their visibility.

presentation.Masters[0].HeaderFooterManager.SetFooterText("Hello World");
presentation.Masters[0].HeaderFooterManager.SetFooterAndChildFootersText("Hello World");
presentation.Masters[0].HeaderFooterManager.SetFooterAndChildFootersVisibility(true);
ILayoutSlide titleslide= presentation.Masters[0].LayoutSlides.GetByType(SlideLayoutType.Title);
titleslide.HeaderFooterManager.SetFooterText("title slide");
titleslide.HeaderFooterManager.SetFooterAndChildFootersVisibility(true);

I hope the shared information will be helpful.