Searching for comments

J

John Doue

In Word97, searching for comments used ^a. This does not seem to work
for latest versions of Word. Any ideas?

Thanks
 
W

Word Heretic

G'day John Doue <[email protected]>,

ActiveDocument.Comments(1)

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


John Doue reckoned:
 
J

John Doue

Word said:
G'day John Doue <[email protected]>,

ActiveDocument.Comments(1)

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


John Doue reckoned:
Thanks for the prompt answer. However, my previous macro used the
following routine:

With Selection.Find
.Text = "^a"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute

How do I need to modify it? Sorry, but as you can tell, my expertise is
really limited.

Thanks
 
J

John Doue

Word said:
G'day John Doue <[email protected]>,

ActiveDocument.Comments(1)

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


John Doue reckoned:
Thanks for the prompt answer. However, my previous macro used the
following routine:

With Selection.Find
.Text = "^a"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute

How do I need to modify it? Sorry, but as you can tell, my expertise is
really limited.

Forgot to mention: of course, I could use WordBasic.DeleteAllCommentsInDoc
but I wish to keep count of comments deleted.

Thanks
 
P

Peter

John Doue said:
Thanks for the prompt answer. However, my previous macro used the
following routine:

With Selection.Find
.Text = "^a"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute

How do I need to modify it? Sorry, but as you can tell, my expertise is
really limited.

Forgot to mention: of course, I could use WordBasic.DeleteAllCommentsInDoc
but I wish to keep count of comments deleted.

Thanks

Try the following::


Dim i As Integer
Dim cmt As Comment

With ActiveDocument
i = .Comments.Count
For Each cmt In .Comments
cmt.Delete
Next
End With

Call MsgBox("Deleted " & i & " comments")

Set cmt = Nothing


hth,

-Peter
 
J

John Doue

Peter said:
Try the following::


Dim i As Integer
Dim cmt As Comment

With ActiveDocument
i = .Comments.Count
For Each cmt In .Comments
cmt.Delete
Next
End With

Call MsgBox("Deleted " & i & " comments")

Set cmt = Nothing


hth,

-Peter
Thanks Peter, I am very grateful. Works as expected.
 
W

Word Heretic

G'day John Doue <[email protected]>,

Count=ActiveDocument.Comments.Count
WordBasic.DeleteAllCommentsInDoc

is much faster

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


John Doue reckoned:
 
J

John Doue

Word said:
G'day John Doue <[email protected]>,

Count=ActiveDocument.Comments.Count
WordBasic.DeleteAllCommentsInDoc

is much faster

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


John Doue reckoned:
Thanks Steve ... difficult to make this macro shorter!

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top