Configuration logicielle requise Avis avec MS Word - Comment puis-je obtenir des mesures d'une manière automatisée?
-
22-08-2019 - |
Question
Disons que j'ai un document sur les conditions dans MS Word, et quelqu'un d'autre en fait une critique de fournit une liste des problèmes rencontrés en utilisant la fonction « Suivi des modifications ».
Y at-il un moyen d'extraire « combien de problèmes majeurs / mineurs ont été trouvés lors de l'examen? » à l'aide d'un script automatisé - à des fins de métriques
Je vois CodeCollaborator a une certaine intégration MS Word, mais il ne semble pas savoir comment regarder l'intérieur de Word pour extraire les données de suivi des modifications. Il lance simplement le document.
La solution
J'ai fait une fois écrire une macro Word qui extrait les commentaires à un document distinct, nous vous invitons à essayer d'adapter cela à vos besoins, si vous avez du mal puis répondre ici et je peux vous donner un coup de main avec des changements.
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