G
Guest
Hello!
Does anyone have an example macro that can loop thru each of the various
levels of a WORD document down to the WORD level? ie similar to the following
pseudocode?
For Each oSection In ActiveDocument.Sections
for each oPara in oSection.Item
for each oSentence in oPara.Item
for each oWword in oSentence.Item
If aword.HighlightColorIndex = wdYellow Then
MsgBox
(oSection.Text(1)+oPara.Text(1)+oSentence.Text(1)+aword)
End If
next oWord
Next OSentence
Next oPara
Next oSection
Basically, what i'm trying to create is a 'notes taken' index with hyperlnks
back to the notes that i've hightlighted, so when i run the macro, i'll end
up with a sub document of the highlighted text plus the 1st sentence in the
Section, the first sentence in the paragraph ect.
Thanks very much for any examples on how to do this!
BobK
Does anyone have an example macro that can loop thru each of the various
levels of a WORD document down to the WORD level? ie similar to the following
pseudocode?
For Each oSection In ActiveDocument.Sections
for each oPara in oSection.Item
for each oSentence in oPara.Item
for each oWword in oSentence.Item
If aword.HighlightColorIndex = wdYellow Then
MsgBox
(oSection.Text(1)+oPara.Text(1)+oSentence.Text(1)+aword)
End If
next oWord
Next OSentence
Next oPara
Next oSection
Basically, what i'm trying to create is a 'notes taken' index with hyperlnks
back to the notes that i've hightlighted, so when i run the macro, i'll end
up with a sub document of the highlighted text plus the 1st sentence in the
Section, the first sentence in the paragraph ect.
Thanks very much for any examples on how to do this!
BobK