HighlightRegex
IPresentation.HighlightRegex method
Highlights all matches of the regular expression with the specified color.
public void HighlightRegex(Regex regex, Color highlightColor, IFindResultCallback callback)
Parameter | Type | Description |
---|---|---|
regex | Regex | The regular expression Regex to get strings to highlight. |
highlightColor | Color | The color to highlight the text. |
callback | IFindResultCallback | The callback object for receiving search results IFindResultCallback . |
Examples
The following code sample shows how to highlight text in a PowerPoint Presentation using a regular expression.
[C#]
using (Presentation presentation = new Presentation("SomePresentation.pptx"))
{
Regex regex = new Regex(@"\b[^\s]{10,}\b");
// highlighting all words with 10 or more characters
presentation.HighlightRegex(regex, Color.Blue, null);
presentation.Save("SomePresentation-out.pptx", SaveFormat.Pptx);
}
See Also
- interface IFindResultCallback
- interface IPresentation
- namespace Aspose.Slides
- assembly Aspose.Slides