Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7432871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:31:36+00:00 2026-05-29T09:31:36+00:00

How do I find and remove repeated words from sentences in PowerPoint? As a

  • 0

How do I find and remove repeated words from sentences in PowerPoint?

As a grammar check I want to find double words which are typed by mistake. For example:

Stackoverflow is a a greate site

In this example, one “a” would be removed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:31:38+00:00Added an answer on May 29, 2026 at 9:31 am

    My friend, you are embarking on a dangerous mission if you are trying to re-invent automatic grammar checking. Natural language is filled with exceptions guaranteed to evade whatever small set of rules you think will do the job.

    Anyhow, below is a lucidly naive stab at it. Now, this code works for the example you gave. It will remove that extra “a”. But please be aware that not every repeated word should be removed if you care about preserving grammar, syntax and semantics. Automatically removing repeated “that”s will work wonders on this:

    I love that that site.

    but it will alter the writer’s intent on this by taking the grammar down to a very informal level:

    She said that that is a great site.

    and removing repeats will ruin absolutely everything here:

    That that is is that that is not is not that that is that that is is not true is not true.

    not to mention this:

    Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo.

    Be prepared for disaster! But anyway, the code works for your example (and more) and provides a framework for you to build upon and to fine-tune such that it works in the majority of cases relevant to you.

    Dim shp As Shape
    Dim str As String
    Dim wordArr() As String
    Dim words As Collection
    Dim iWord As Long
    Dim thisWord As String
    Dim nextWord As String
    Dim newText As String
    
    For Each shp In ActivePresentation.Slides(1).Shapes
        If shp.HasTextFrame Then
            'Get the text
            str = shp.TextFrame.TextRange.Text
            'Split it into an array of words
            wordArr = Split(str, " ")
    
            'Transfer to a Collection, easier to deal with than array.
            Set words = New Collection
            For iWord = LBound(wordArr) To UBound(wordArr)
                words.Add wordArr(iWord)
            Next iWord
    
            'Look for repeats.
            For iWord = words.Count - 1 To 1 Step -1
                thisWord = words.Item(iWord)
                nextWord = words.Item(iWord + 1)
    
                'Make sure commas don't get in the way of a comparison
                'e.g. "This is a great, great site" is fine
                'but "This site is great great, and I love it" is not.
                nextWord = Replace(nextWord, ",", "")
                'Add whatever other filtering you feel is appropriate.
                'e.g. period, case sensitivity, etc.
    
                If LCase(thisWord) = LCase(nextWord) Then
                    If LCase(thisWord) = "that" Then
                        'Do nothing. "He said that that was great." is ok.
                        'This is just an example. "had" is another.
                        'Add more filtering here.
                    Else
                        words.Remove iWord + 1
                    End If
                End If
            Next iWord
    
            'Assemble the text with repeats removed.
            newText = ""
            For iWord = 1 To words.Count
                newText = newText & words.Item(iWord) & " "
            Next iWord
    
            'Finally, put it back on the slide.
            shp.TextFrame.TextRange.Text = newText
        End If
    Next shp
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to find and remove unused Delphi runtime packages from a project that uses
In MOSS2007 I need to find and remove for example the default content type
The following code should find the appropriate project tag and remove it from the
I can't seem to find the function to remove a shape or path from
How to find and remove a UIImageView from the collection of ParentViewController.View.Subviews very quick?
Is this a valid way to find and remove item from a LinkedList in
Someone helped me find JavaScript code to remove hidden form fields from submission and
is there an quick way to find(and remove) all escape sequences from a Stream/String??
I'm putting together a script to find remove duplicates in a large library of
Using regular expressions in C#, is there any way to find and remove duplicate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.