A family of Microsoft word processing software products for creating web, email, and print documents.
Hi Anfy,
Try something along the lines of:
Sub AutoBkMk()
Dim i As Long, oSty As Style, fRng As Range
i = 0
With ActiveDocument
For Each oSty In .Styles
If InStr(oSty.NameLocal, "AIO") > 0 Then
With .Range
With .Find
.Style = oSty.NameLocal
.Text = ""
.Forward = True
.MatchWildcards = False
.Wrap = wdFindStop
.MatchCase = False
.Execute
End With
Do While .Find.Found
i = i + 1
Set fRng = .Duplicate
With fRng
ActiveDocument.Bookmarks.Add "AA_BD" & i, fRng
.Collapse Direction:=wdCollapseEnd
End With
.Find.Execute
Loop
End With
End If
Next
End With
Set fRng = Nothing
End Sub