Highlight and List All the Highlighted Words in PowerPoint Presentations in C#

Hi Team,

How can we highlight text in ppt using Regex along with add comments. Need to prepare summary also with information like words found on which page and how many times.
Following are the raw inputs:

No option to attach ppt file so sharing content in .docx file.

Ppt-Slides-Sample-Text.docx (13.9 KB)

Code Sample:

public List<HighlightedWordsClass> HighlightWordsInPpt(string licensePath, string pptPath)
{
    List<HighlightedWordsClass> objReturn = new List<HighlightedWordsClass>();
    License license = new License();
    license.SetLicense(licensePath);
    Presentation presentation = new Presentation(pptPath);

    List<WordListClass> listOfWords = new List<WordListClass>();
    listOfWords.Add(new WordListClass("Lorem", "Lorem is the word and this is comment for it.", true, true));
    listOfWords.Add(new WordListClass("porttitor", "porttitor is the word and this is comment for it.", false, true));
    listOfWords.Add(new WordListClass("volutpat", "volutpat is the word and this is comment for it.", false, true));
    listOfWords.Add(new WordListClass("felis", "felis is the word and this is comment for it.", false, true));

    return objReturn;
}


public class WordListClass
{
    public WordListClass(string word, string comment, bool isCase, bool isMatch)
    {
        Word = word;
        Comments = comment;
        isCase = IsCaseSensitive;
        IsMatchWholeWorld = isMatch;
    }
    public string Word { get; set; }
    public string Comments { get; set; }
    public bool IsCaseSensitive { get; set; }
    public bool IsMatchWholeWorld { get; set; }
}
public class HighlightedWordsClass
{
    public string Word { get; set; }
    public List<FindingClass> findings { get; set; }
}
public class FindingClass
{
    public int PageNumber { get; set; }
    public int Occurences { get; set; }
}

Thank you in Advance!

@Jaibir,
Thank you for posting your requirements.

With Aspose.Slides for .NET, you can highlight text using regular expressions, but unfortunately, I have not found a way to list the highlighted words.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESNET-44473

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like

Hi @andrey.potapov

Instead of highlighting text using for each slide loop. Do we have option to highlight in 1 go in all slides.
Like we have following code for highlight in word:

Doc.Range.Replace(regexString, "$0", option1);

And following code for highlight in pdf:

TextFragmentAbsorber tfa = new TextFragmentAbsorber(regexSt, textSearchOptions);
doc.Pages.Accept(tfa);

Do we have similar method for .ppt files?

Thanks in Advance!

@Jaibir,
Thank you for the details. I’ve forwarded them to our developers.

1 Like

Hi @andrey.potapov
Any update on the ticket :
SLIDESNET-44473

@Jaibir,
As far as I can see, our developers are working on the issue. Unfortunately, I don’t have any additional information yet.