Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Comments

Status
Not open for further replies.

bobbsta

Instructor
Feb 13, 2002
12
GB
Hello there

Hope all are well :)

Word 2002/XP

Is there any way of printing the comments at the bottom of the page and not in balloons (like the older versions of Word)?

Many thanks

Bobbsta
 
Yes, if you want to take all the comments (per page) and pull the text out and insert them as footnotes. Here is some code that will do that.

NOTE: the comments from individual pages are pulled into the footnotes in reverse order. They then show up in the footnotes in proper order, that is, the order they appear on the page.

Code:
Sub MakeCommentsFootnotes()
Dim aDoc As Document
Dim i As Integer
Dim cCount As Integer
Dim strComment As String
Dim r As Range
Dim var
Dim var2

Set aDoc = ActiveDocument
  
Selection.HomeKey Unit:=wdStory
i = 1
On Error Resume Next
For var2 = 1 To aDoc.BuiltInDocumentProperties(wdPropertyPages)
' select current page
    
    Set r = aDoc.Range(Start:=aDoc.Bookmarks("\page").Start, _
        End:=aDoc.Bookmarks("\page").End)
' get a count of comments on the page
    cCount = r.Comments.Count

    If cCount > 0 Then
' collapse selection to keep it on same page
       Selection.Collapse direction:=wdCollapseStart
       For var = 1 To cCount
 ' select LAST comment on page as
 ' footnotes list in reverse order
         aDoc.Comments(i + (cCount - 1)).Range.Select
 ' set string for comment text
            strComment = Selection.Text

 ' close the comments pane to allow editing
  ActiveWindow.ActivePane.Close
  If ActiveWindow.View.SplitSpecial = wdPaneNone Then
     ActiveWindow.ActivePane.View.Type = wdPrintView
  Else
     ActiveWindow.View.Type = wdPrintView
  End If
            
 ' use current page range to set footnote
     With aDoc.Range(Start:=aDoc.Bookmarks("\page").Range.Start, End:= _
         aDoc.Bookmarks("\page").End)
        With .FootnoteOptions
           .Location = wdBottomOfPage
           .NumberingRule = wdRestartContinuous
           .StartingNumber = 1
           .NumberStyle = wdNoteNumberStyleArabic
        End With
       .Footnotes.Add Range:=Selection.Range, Reference:=""
      End With
      Selection.TypeText Text:=strComment
      i = i - 1
     Next  ' next comment on current page
   Else
   End If
' go to next page
Selection.GoTo What:=wdGoToPage, _
     Which:=wdGoToNext, Count:=1, Name:=""
    i = ((aDoc.Comments.Count - cCount) + 1)
Next
Set aDoc = Nothing
End Sub


Gerry
 
Oh, and of course you would have to have footnotes set to print.

Gerry
 
Or just print on a separate page by going to Print - Options - Include comments, which will print on last page...not as good as fumei's solution but easy M
 
Stroppy's point should be well noted. This is an aspect of good design - thinking about what you actually need.

If you just want the Comments printed, then just print them. If you want the Comments specifically at the bottom of the page, then you have to do processing.

Always consider the easiest approach to what you need. And that starts with being clear on what you DO need.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top