HighlightText
Contents
[
Hide
]HighlightText(string, Color)
Highlight all matches of sample in text frame text using specified color.
public void HighlightText(string text, Color highlightColor)
Parameter | Type | Description |
---|---|---|
text | String | Text sample to highlight. |
highlightColor | Color | Highlighting color. |
See Also
- class TextFrame
- namespace Aspose.Slides
- assembly Aspose.Slides
HighlightText(string, Color, ITextHighlightingOptions)
Highlight all matches of sample in text frame text using specified color.
public void HighlightText(string text, Color highlightColor, ITextHighlightingOptions options)
Parameter | Type | Description |
---|---|---|
text | String | Text sample to highlight. |
highlightColor | Color | Highlighting color. |
options | ITextHighlightingOptions | Highlighting options. |
Examples
The following sample code shows how to Highlight Text in a PowerPoint Presentation.
[C#]
using (Presentation presentation = new Presentation("SomePresentation.pptx")){
// highlighting all words 'important'
((AutoShape)presentation.Slides[0].Shapes[0]).TextFrame.HighlightText("title", Color.LightBlue);
// highlighting all separate 'the' occurrences
((AutoShape)presentation.Slides[0].Shapes[0]).TextFrame.HighlightText("to", Color.Violet, new TextHighlightingOptions()
{
WholeWordsOnly = true
});
presentation.Save("SomePresentation-out2.pptx", SaveFormat.Pptx);
}
See Also
- interface ITextHighlightingOptions
- class TextFrame
- namespace Aspose.Slides
- assembly Aspose.Slides