www.tursoft.net
tursoft@tursoft.net
Atom v1.0My Yahoo! hesabına ekleMy MSN hesabına ekle
Uğur Umutluoğlu
GEZEGENIEEE
Bilen YAVUZ
VBA Code for Listing Document Comments in Microsoft Word
 
Blow code is a VBA macro for listing comments placed in a document.
Insert below code as a macro in MS Word and then run it when your document is opened.

Code will find all the comments in your document and list them in a new document with their page number.

Code:

Sub ListCommentsWithPageNumbers()

'
' ListCommentsWithPageNumbers Macro
' Macro created 20.03.2006 by Muhammet TURŞAK
'


Dim count As Integer
count = ActiveDocument.Comments.count
Dim str As String
str =""
str = str & "=================================" & vbCrLf
str = str & "DOCUMENT COMMENT LIST" & vbCrLf
str = str & "-----------------------------------------------" & vbCrLf
str = str & "File Path : " & ActiveDocument.Path & vbCrLf
str = str & "List Date : " & Now & vbCrLf
str = str & "Username : " & Application.UserName & vbCrLf
str = str & "===================================" & vbCrLf & vbCrLf & vbCrLf


For i = 1 To count
Dim pageNo As Integer
pageNo = ActiveDocument.Comments(i).Reference.Information(wdActiveEndAdjustedPageNumber)
str = str & ActiveDocument.Comments.Item(i).range.Text & vbCrLf
str = str & "Page : " & pageNo & vbCrLf
str = str & "______________________________ " & vbCrLf & vbCrLf
Next
Dim
d As Document

Set d = Application.Documents.Add()
d.range.Font.Name = "Arial"
d.range.Font.Size = 10
d.range.Text = ActiveDocument.range.Text & str


End Sub

Çarşamba, Mart 22, 2006  @ 13:26 0 yorum var
Copyright (c) 2006 Muhammet TURŞAK - Tüm hakları saklıdır.