HighlightRegex
TextFrame.HighlightRegex method
Highlight all matches of regular expression in text frame text using specified color.
public void HighlightRegex(string regex, Color highlightColor, ITextHighlightingOptions options)
Parameter | Type | Description |
---|---|---|
regex | String | Text of regular expression to get text to highlight. |
highlightColor | Color | Highlighting color. |
options | ITextHighlightingOptions | Highlighting options. |
Examples
The following sample code shows how to Highlight Text using regular expression in a PowerPoint Presentation.
[C#]
using (Presentation presentation = new Presentation("SomePresentation.pptx")){
TextHighlightingOptions options = new TextHighlightingOptions();
// highlighting all words with 10 symbols or longer
((AutoShape)presentation.Slides[0].Shapes[0]).TextFrame.HighlightRegex(@"\b[^\s]{5,}\b", Color.Blue, options);
presentation.Save("SomePresentation-out.pptx", SaveFormat.Pptx);
}
See Also
- interface ITextHighlightingOptions
- class TextFrame
- namespace Aspose.Slides
- assembly Aspose.Slides