PC Review


Reply
Thread Tools Rate Thread

Bulk Delete Comments with a Specific Phrase

 
 
Refresher
Guest
Posts: n/a
 
      4th Apr 2008
Hello,
I have 1000 comments in a word document with a specific phrase in it, say
"AAA". I want to delete all of those in bulk without deleting the rest of the
comments. Is there a way to do this?
Thanks.
 
Reply With Quote
 
 
 
 
Suzanne S. Barnhill
Guest
Posts: n/a
 
      4th Apr 2008
If these are comments by a specific reviewer, you can display the markup of
just that reviewer and use Delete All Comments Shown.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"Refresher" <(E-Mail Removed)> wrote in message
news:EB39AA63-9EE4-4097-BE63-(E-Mail Removed)...
> Hello,
> I have 1000 comments in a word document with a specific phrase in it, say
> "AAA". I want to delete all of those in bulk without deleting the rest of
> the
> comments. Is there a way to do this?
> Thanks.



 
Reply With Quote
 
Refresher
Guest
Posts: n/a
 
      4th Apr 2008
Thanks for the reply. Unfortunately they are all by the same reviewer.

"Suzanne S. Barnhill" wrote:

> If these are comments by a specific reviewer, you can display the markup of
> just that reviewer and use Delete All Comments Shown.
>
> --
> Suzanne S. Barnhill
> Microsoft MVP (Word)
> Words into Type
> Fairhope, Alabama USA
>
> "Refresher" <(E-Mail Removed)> wrote in message
> news:EB39AA63-9EE4-4097-BE63-(E-Mail Removed)...
> > Hello,
> > I have 1000 comments in a word document with a specific phrase in it, say
> > "AAA". I want to delete all of those in bulk without deleting the rest of
> > the
> > comments. Is there a way to do this?
> > Thanks.

>
>
>

 
Reply With Quote
 
Jay Freedman
Guest
Posts: n/a
 
      4th Apr 2008
As often happens when you want to do something slightly unusual, you need a
macro:

Sub DeleteSomeComments()
Dim oCm As Comment
Dim strPhrase As String

strPhrase = InputBox( _
"What phrase signals a comment to delete?", _
"Delete comments containing a phrase")
If Len(strPhrase) = 0 Then Exit Sub

For Each oCm In ActiveDocument.Comments
If InStr(LCase(oCm.Range.Text), LCase(strPhrase)) Then
oCm.Delete
End If
Next
End Sub

See http://www.gmayor.com/installing_macro.htm if needed.

The comparison in this macro is not case-sensitive -- for example, if you
enter aaa, then the macro will delete comments containing AAA, AaA, aAa, and
so forth. If you want it to be case-sensitive, remove the word LCase from
the two places it occurs in the code.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Refresher wrote:
> Thanks for the reply. Unfortunately they are all by the same reviewer.
>
> "Suzanne S. Barnhill" wrote:
>
>> If these are comments by a specific reviewer, you can display the
>> markup of just that reviewer and use Delete All Comments Shown.
>>
>> --
>> Suzanne S. Barnhill
>> Microsoft MVP (Word)
>> Words into Type
>> Fairhope, Alabama USA
>>
>> "Refresher" <(E-Mail Removed)> wrote in message
>> news:EB39AA63-9EE4-4097-BE63-(E-Mail Removed)...
>>> Hello,
>>> I have 1000 comments in a word document with a specific phrase in
>>> it, say "AAA". I want to delete all of those in bulk without
>>> deleting the rest of the
>>> comments. Is there a way to do this?
>>> Thanks.



 
Reply With Quote
 
Refresher
Guest
Posts: n/a
 
      4th Apr 2008
Thank you Jay!

"Jay Freedman" wrote:

> As often happens when you want to do something slightly unusual, you need a
> macro:
>
> Sub DeleteSomeComments()
> Dim oCm As Comment
> Dim strPhrase As String
>
> strPhrase = InputBox( _
> "What phrase signals a comment to delete?", _
> "Delete comments containing a phrase")
> If Len(strPhrase) = 0 Then Exit Sub
>
> For Each oCm In ActiveDocument.Comments
> If InStr(LCase(oCm.Range.Text), LCase(strPhrase)) Then
> oCm.Delete
> End If
> Next
> End Sub
>
> See http://www.gmayor.com/installing_macro.htm if needed.
>
> The comparison in this macro is not case-sensitive -- for example, if you
> enter aaa, then the macro will delete comments containing AAA, AaA, aAa, and
> so forth. If you want it to be case-sensitive, remove the word LCase from
> the two places it occurs in the code.
>
> --
> Regards,
> Jay Freedman
> Microsoft Word MVP FAQ: http://word.mvps.org
> Email cannot be acknowledged; please post all follow-ups to the newsgroup so
> all may benefit.
>
> Refresher wrote:
> > Thanks for the reply. Unfortunately they are all by the same reviewer.
> >
> > "Suzanne S. Barnhill" wrote:
> >
> >> If these are comments by a specific reviewer, you can display the
> >> markup of just that reviewer and use Delete All Comments Shown.
> >>
> >> --
> >> Suzanne S. Barnhill
> >> Microsoft MVP (Word)
> >> Words into Type
> >> Fairhope, Alabama USA
> >>
> >> "Refresher" <(E-Mail Removed)> wrote in message
> >> news:EB39AA63-9EE4-4097-BE63-(E-Mail Removed)...
> >>> Hello,
> >>> I have 1000 comments in a word document with a specific phrase in
> >>> it, say "AAA". I want to delete all of those in bulk without
> >>> deleting the rest of the
> >>> comments. Is there a way to do this?
> >>> Thanks.

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bulk transfer of comments using a range DB042188 Microsoft Excel Programming 3 10th Apr 2008 01:00 AM
an if( statement looking for a specific phrase anywhere in a cell Bob Phillips Microsoft Excel Worksheet Functions 3 26th Sep 2006 12:13 AM
Conditional formatting specific phrase =?Utf-8?B?SmthbHNjaA==?= Microsoft Excel Worksheet Functions 1 4th May 2006 09:25 PM
How to highlight a row containing specific phrase? =?Utf-8?B?Sm9zZWYgVm9zeWth?= Microsoft Excel Worksheet Functions 8 5th Nov 2005 06:05 PM
How do I search for emails containing a specific phrase? =?Utf-8?B?SnVsaWUgQiBBdmVudHVyYQ==?= Microsoft Outlook Discussion 2 4th Feb 2005 10:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:57 AM.