Interesting challenge. The following code is based on the structure you have defined and tested only on a small sample of text. It requires that each set (the question type, question, ~ text, @ text, and answers each consist of a single paragraph. So in your example the set is 9 paragraphs total. Each set is delimited from the other sets by a empty paragraph:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim lngIndex As Long
Dim strFind As String
Dim oRng As Word.Range
Dim oRngBox As Word.Range
Dim oSrchRng As Word.Range
Set oRng = ActiveDocument.Range
oRng.Collapse wdCollapseStart
Do
Do
On Error Resume Next
oRng.MoveEnd wdParagraph
If Err.Number <> 0 Then Exit Do
Loop Until oRng.Characters.Last.Next = Chr(13)
On Error GoTo 0
For lngIndex = 5 To oRng.Paragraphs.Count
strFind = oRng.Paragraphs(lngIndex).Range.Text
strFind = Right(strFind, Len(strFind) - InStr(strFind, ".") - 1)
strFind = Left(strFind, Len(strFind) - 1)
Set oSrchRng = oRng.Paragraphs(3).Range
Set oRngBox = oSrchRng.Duplicate
Selection.Find.ClearFormatting
With oSrchRng.Find
.Text = strFind
While .Execute
If oSrchRng.InRange(oRngBox) Then
With oSrchRng
If oSrchRng.Characters.Last.Next = "." Then oSrchRng.MoveEnd wdCharacter, 1
.InsertBefore "<font color = ""#008000"">"
.InsertAfter "</font>"
.Collapse wdCollapseEnd
End With
End If
Wend
End With
Set oSrchRng = oRng.Paragraphs(4).Range
With oSrchRng.Find
.Text = strFind
While .Execute
If oSrchRng.InRange(oRngBox) Then
With oSrchRng
If oSrchRng.Characters.Last.Next = "." Then oSrchRng.MoveEnd wdCharacter, 1
.InsertBefore "<font color = ""#008000"">"
.InsertAfter "</font>"
.Collapse wdCollapseEnd
End With
End If
Wend
End With
Next lngIndex
oRng.Collapse wdCollapseEnd
oRng.MoveStart wdParagraph, 1
Loop Until oRng.End = ActiveDocument.Range.End - 1
End Sub
Please visit my website: http://gregmaxey.mvps.org/word_tips.html