Thanks Cindy. The macro is pretty handy too!
"Cindy M -WordMVP-" wrote:
Hi ?B?UGVyZm9ybWFuY2UgYnkgRGVzaWdu?=,
I'm using Word 2002 (Office XP). I'm using the Review Mode to make comments.
The default print comments mode will collect all comments fields, (i.e.
header, footer, endnot items and comments). Each field is separated by a
title bar. The problem is that it prints a title bar even when there is no
information in that field. I'd like to print only those fields with
information.
Actually, the true "default" comments mode will print the comments in balloons.
You only get the "task pane" mode when you've turned off comments in balloons
(which is why I asked about mode).
There is no way built into Word that will let you suppress "fields" that don't
contain comments. This is just the way it works. Here's a macro that will list
all the comments in the body of a document in a new document
Sub ListCommentsInDoc()
Dim cmt As Word.Comment
Dim docSource As Word.Document
Dim docTarget As Word.Document
Dim rng As Word.Range
Set docSource = ActiveDocument
Set docTarget = Documents.Add
Set rng = docTarget.Range
rng.Text = "Comments in " & docSource.FullName & vbCr
rng.Style = wdStyleHeading1
rng.Collapse wdCollapseEnd
rng.Style = wdStyleNormal
For Each cmt In docSource.Comments
rng.Text = cmt.Range.Text & vbCr & vbC4
rng.Collapse wdCollapseEnd
Next
End Sub
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)