myHeadings(icount) just returns the element from the array, and has no connection to the paragraph in the document.
The following code will however do what you want:
Code:
Dim bkmarkname As String
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Heading 5")
With Selection.Find
Do While .Execute(FindText:="", MatchWildcards:=False, Forward:=True, Wrap:=wdFindStop) = True
With Selection
bkmarkname = Mid(.Range.Text, InStr(.Range.Text, "|") + 2, InStrRev(.Range.Text, "|") - InStr(.Range.Text, "|") - 2)
ActiveDocument.Bookmarks.Add Trim(bkmarkname), .Range
.Collapse wdCollapseEnd
End With
Loop
End With