Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Copying comments between documents
Hi Word Gurus,
Is there an easy way to copy all the comments in one Word document to another Word document using Word 2007 (or Word 2003 if necessary)? Kind Regards JD2 |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Copying comments between documents
You need a macro to copy from the current document to another e.g..
Sub ExtractComments() Dim sDoc As Document Dim tDoc As Document Dim sLine As Integer Dim sPage As Integer Set sDoc = ActiveDocument Set tDoc = Documents.Add With sDoc For i = 1 To .Comments.Count .Comments(i).Reference.Select sPage = Selection.Information(wdActiveEndPageNumber) sLine = Selection.Information(wdFirstCharacterLineNumber) If i = 1 Then tDoc.Range.InsertAfter .Comments(i).Range.Text Else tDoc.Range.InsertAfter vbCr & .Comments(i).Range.Text End If tDoc.Range.InsertAfter " - Page " & _ sPage & ", Line " & sLine Next i End With tDoc.Activate End Sub http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org JD2 wrote: Hi Word Gurus, Is there an easy way to copy all the comments in one Word document to another Word document using Word 2007 (or Word 2003 if necessary)? Kind Regards JD2 |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Copying comments between documents
If by "copy", you actually mean extract, then running a macro that contains
the following code when the document containing the comments is the active document will create a new document containing a table with the comments, the page number on which they appear and the author's name: Dim Source As Document, Target As Document Dim TTable As Table Dim TRow As Row Dim acomment As Comment Set Source = ActiveDocument Set Target = Documents.Add Set TTable = Target.Tables.Add(Target.Range, 1, 3) With TTable.Rows(1) .Cells(1).Range.Text = "Comment" .Cells(2).Range.Text = "Page Number" .Cells(3).Range.Text = "Author" End With For Each acomment In Source.Comments Set TRow = TTable.Rows.Add TRow.Cells(1).Range.Text = acomment.Range acomment.Range.Select TRow.Cells(2).Range.Text = Selection.Information(wdActiveEndPageNumber) TRow.Cells(3).Range.Text = acomment.Author Next acomment -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "JD2" wrote in message ... Hi Word Gurus, Is there an easy way to copy all the comments in one Word document to another Word document using Word 2007 (or Word 2003 if necessary)? Kind Regards JD2 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copying comments | Microsoft Word Help | |||
Copying styles between documents | Microsoft Word Help | |||
Copying documents that contain hyperlinks | Microsoft Word Help | |||
Ignore styles while copying between documents | Page Layout | |||
Copying sub-documents into a new folder | Formatting Long Documents |