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