Code: Select all
With source
' Process the comments
For i = 1 To .Comments.Count
With .Comments(i)
StrCmt = StrCmt & vbCr & _
.Reference.Information(wdActiveEndAdjustedPageNumber) & _
vbTab & .Author & vbTab & .Date & vbTab & _
Replace(Replace(.Range.Text, vbTab, "<TAB>"), vbCr, "<P>") & _
vbTab & source.Name
End With
Next i
.Close SaveChanges:=False
End With
Code: Select all
With source
If .Comments.Count = 0 Then
StrCmt = StrCmt & vbCrLf & _
"No comments in this document" & vbTab & vbTab & vbTab & _
vbTab & source.Name
Else
' Process the comments
For i = 1 To .Comments.Count
With .Comments(i)
StrCmt = StrCmt & vbCr & _
.Reference.Information(wdActiveEndAdjustedPageNumber) & _
vbTab & .Author & vbTab & .Date & vbTab & _
Replace(Replace(.Range.Text, vbTab, "<TAB>"), vbCr, "<P>") & _
vbTab & source.Name
End With
Next i
End If
.Close SaveChanges:=False
End With