Hi Team,
I was using an older version of aspose and recently upgraded to 17.11. Could you please let me if the Presentation.UpdateSlideNumberFields and UpdateDateTimeFields has any new property in this version as it has become obsolete now.
Presentation.UpdateSlideNumberFields and UpdateDateTimeFields is obsolete. what is the new reference
Hello,
Is someone looking into this? Please provide some info ASAP.
I have observed your requirements. Since, Aspose.Slides for .NET 16.2.0, Properties UpdateDateTimeFields and UpdateSlideNumberFields have been removed from Aspose.Slides.Presentation class and from Aspose.Slides.IPresentation interface.
The Text property of Aspose.Slides.TextFrame, Paragraph, Portion classes and Aspose.Slides.ITextFrame, IParagraph, IPortion interfaces returns text with updated “datetime” fields.
The following sample code shall also help you in adding a slide number field types in presentation.
public static void InsertAutoShape()
{
Presentation pres = new Presentation();
ISlide slide = pres.Slides[0];
IAutoShape ashp = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 10, 10, 100, 50);
ashp.AddTextFrame(String.Empty);
IPortion portion = ashp.TextFrame.Paragraphs[0].Portions[0];
portion.AddField(FieldType.SlideNumber);
pres.Save(@"C:\Aspose Data\Field.pptx", Aspose.Slides.Export.SaveFormat.Pptx);
}
Should I do this for each slide in a presentation?
I suggest you to please try using following alternate options using HeaderFooterManager class.
pres.HeaderFooterManager.SetAllDateTimesText("");
pres.HeaderFooterManager.SetAllSlideNumbersVisibility(true);
pres.HeaderFooterManager.SetVisibilityOnAllTitleSlides(true);