FindAndReplaceText
SlideUtil.FindAndReplaceText method
Finds and replaces text in presentation with given format
public static void FindAndReplaceText(IPresentation presentation, bool withMasters, string find,
string replace, PortionFormat format = null)
Parameter | Type | Description |
---|---|---|
presentation | IPresentation | Scanned presentation. |
withMasters | Boolean | Determines whether master slides should be scanned. |
find | String | String value to find. |
replace | String | String value to replace. |
format | PortionFormat | Format for replacing text portion. If null then will be used format of the first character of the found string |
Examples
[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
PortionFormat format = new PortionFormat
{
FontHeight = 24f,
FontItalic = NullableBool.True,
FillFormat =
{
FillType = FillType.Solid,
SolidFillColor =
{
Color = Color.Red
}
}
};
Aspose.Slides.Util.SlideUtil.FindAndReplaceText(pres, true, "[this block] ", "my text ", format);
pres.Save("replaced", SaveFormat.Pptx);
}
See Also
- interface IPresentation
- class PortionFormat
- class SlideUtil
- namespace Aspose.Slides.Util
- assembly Aspose.Slides