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 | The text to highlight. |
highlightColor | Color | The color to highlight the text. |
Examples
The following code sample shows how to highlight text in a PowerPoint presentation.
[C#]
using (Presentation presentation = new Presentation("SomePresentation.pptx"))
{
// highlighting all separate 'the' occurrences
presentation.HighlightText("the", Color.Violet);
presentation.Save("SomePresentation-out2.pptx", SaveFormat.Pptx);
}
See Also
- interface IPresentation
- 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 PowerPoint presentation.
[C#]
using (Presentation presentation = new Presentation("SomePresentation.pptx"))
{
// highlighting all separate 'the' occurrences
presentation.HighlightText("the", Color.Violet, new TextSearchOptions() {WholeWordsOnly = true}, null);
presentation.Save("SomePresentation-out2.pptx", SaveFormat.Pptx);
}
See Also
- interface ITextSearchOptions
- interface IFindResultCallback
- interface IPresentation
- namespace Aspose.Slides
- assembly Aspose.Slides