Sub BKMCreatePerSection2()
Dim rng As Range
Dim Sec As Section
Dim i As Integer
Dim Suffix() As String
Dim rngBookmark As Range
Suffix = Split("DE,EN,ES,FR,IT", ",")
For Each Sec In ActiveDocument.Sections
Set rng = Sec.Range
With rng.Find
.Format = True
.Style = ActiveDocument.Styles(wdStyleHeading2)
Set rngBookmark = Sec.Range
rngBookmark.MoveEnd wdCharacter, -1
If .Execute Then
ActiveDocument.Bookmarks.Add "Section_Bookmark_" & Suffix(i), rngBookmark
i = i + 1
End If
End With
Next Sec
End Sub
|