Hi Wade,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
I like to share that you may not replace the metacharacters associated with any text frame. However, you can copy the properties of DateTime field and create a new similar shape and add the desired text yourself. For your kind reference, I have updated the code snippet shared by you and hopefully it will help you in resolving the issue.
Presentation pres = new Presentation("D:\\Aspose Data\\YesHeaderFooterNotesAuto.ppt");
Slide slide = null;
int numSlides = pres.Slides.LastSlidePosition;
int x=0, y=0, w=0, h=0;
for (int slideNum = 1; slideNum<pres.Slides.Count;slideNum++)
{
slide = pres.GetSlideByPosition(slideNum);
foreach (Shape shape in slide.Shapes)
{
if (shape.TextFrame != null)
{
TextFrame frame = shape.TextFrame;
if (frame.MetaCharacters != null)
{
MetaCharacterType type = frame.MetaCharacters[0];
switch (type)
{
case MetaCharacterType.DateTime:
slide.HeaderFooter.DateTimeVisible = false;
slide.HeaderFooter.IsDateTimeVisible = false;
x = shape.X;
y = shape.Y;
w = shape.Width;
h = shape.Height;
break;
case MetaCharacterType.Footer:
break;
case MetaCharacterType.GenericDateTime:
break;
case MetaCharacterType.Header:
break;
case MetaCharacterType.SlideNumer:
break;
default:
break;
}
}
}
}
if (x >= 0 && y >= 0)
{
Shape temshape = slide.Shapes.AddRectangle(x, y, w, h);
temshape.AddTextFrame("Hello World");
}
}
pres.Write("D:\\Aspose Data\\TestDate.ppt");
Thanks and Regards,