2

假设我在 MS Word 中有一个需求文档,其他人对其进行审核并提供使用“跟踪更改”功能发现的问题列表。

有没有办法提取“审查过程中发现了多少个主要/次要问题”?使用自动化脚本 - 用于度量目的?

我看到CodeCollaborator有一些 MS Word 集成,但它似乎不知道如何查看 Word 内部以提取跟踪的更改数据。它只是启动文档。

4

1 回答 1

2

我曾经写过一个 Word 宏,可以将评论提取到单独的文档中,欢迎您尝试根据您的目的调整它,如果您遇到问题,请在此处回复,我可以帮助您进行更改。

Public Sub PROCESS_COMMENTS()

Dim strReplaceText As String
Dim myPar As Paragraph
Dim strCurrentColumn As String
Dim i As Integer
Dim Com As Comment

    Application.ScreenUpdating = False

    '   set the input and output docs.
    Set inDoc = ActiveDocument
    '   check we have comments to process in the original document
    If inDoc.Comments.Count < 1 Then
        MsgBox "No comments in the document"
        Exit Sub
    End If

    '   comments exist so create new document
    Set outDoc = Documents.Add
    Set outRange = outDoc.Content

    outDoc.Range.InsertAfter "List of Comments:"
    outDoc.Paragraphs(outDoc.Paragraphs.Count).Style = outDoc.Styles("Heading 1")
    outDoc.Range.InsertParagraphAfter


    '   cycle through comments, inserting them in the new document
    '   display the new document and refresh
    outDoc.Activate
    Application.ScreenRefresh

    For Each Com In inDoc.Comments
        outRange.InsertAfter "[" & Com.Author & " - " & Com.Initial & Com.Index & "] "
        outDoc.Paragraphs(outDoc.Paragraphs.Count).Range.Font.Bold = True
        outDoc.Range.InsertParagraphAfter
        outRange.InsertAfter Com.Range.Text
        outDoc.Paragraphs(outDoc.Paragraphs.Count).Range.Font.Bold = False

        Set myRange = Com.Scope


        outDoc.Range.InsertParagraphAfter
        outDoc.Range.InsertParagraphAfter
    Next

    Application.ScreenUpdating = True
    Set outDoc = ActiveDocument

End Sub
于 2008-12-18T16:47:57.203 回答