Automatically removing repeated words

FrecklePaw
2StarLounger
Posts: 130
Joined: 12 Aug 2020, 08:40

Automatically removing repeated words

Post by FrecklePaw »

Is there a way to remove instances of words that are typed twice within a document, e.g.

If we think a bit about about taking action

Is there a function that will automatically remove the repeated word?

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Automatically removing repeated words

Post by HansV »

Press Ctrl+H to activate the Replace dialog.
Click the More >> button.
Tick the 'Use wildcards' check box.
Enter the following in the 'Find what' box:

(<[A-Za-z]@)[ ,.;:]@\1>

Enter the following in the 'Replace with' box.

\1

Either click 'Find Next' and Replace repeatedly, or click 'Replace All'.
Best wishes,
Hans

FrecklePaw
2StarLounger
Posts: 130
Joined: 12 Aug 2020, 08:40

Re: Automatically removing repeated words

Post by FrecklePaw »

Thanks Hans - perfect!

User avatar
Jay Freedman
Microsoft MVP
Posts: 1313
Joined: 24 May 2013, 15:33
Location: Warminster, PA

Re: Automatically removing repeated words

Post by Jay Freedman »

In Word 2003 and earlier, the spell checker automatically flagged repeated words. In Word 2007 and all later versions, there is an option to turn that check off, but it's turned on by default:
1.png
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Automatically removing repeated words

Post by HansV »

Hi Jay,

That's true, but the spell checker doesn't offer a way to remove them in one go. You have to review each instance and select 'Delete Repeated Word' each time.
Best wishes,
Hans

User avatar
Jay Freedman
Microsoft MVP
Posts: 1313
Joined: 24 May 2013, 15:33
Location: Warminster, PA

Re: Automatically removing repeated words

Post by Jay Freedman »

HansV wrote:
13 Jul 2021, 06:44
Hi Jay,

That's true, but the spell checker doesn't offer a way to remove them in one go. You have to review each instance and select 'Delete Repeated Word' each time.
Yes, that's a consideration. I believe we're thinking of two different scenarios. The Replace is good if you receive a document from elsewhere that's already full of repeated words, or if you just want to do a final check before publishing. The automatic marking of a repeated word when you type it or paste it is appropriate when you're creating a document yourself, when you can fix it immediately.