I wrote the code below to create a bookmark for each paragraph in my multilevel list. It works great in a one time shot, but if you add to the ml list and have used {ref} fields it gets messed up.
Sub BkMk() Dim key As String Dim i As Integer Dim b As Bookmark With ActiveDocument.ListParagraphs For i = 1 To .Count ActiveDocument.Bookmarks.Add Name:="A" & i, Range:=.Item(i).Range Next i End With End Sub
Example:
- [text1] <-- Bookmark Name = A1
- [text2] <-- Bookmark Name = A2
- [text3] <-- Bookmark Name = A3
- {Ref A2} <-- Value when you press F9 is text2
then I add to the list between text1 and text2...
- [text1] <-- Bookmark Name = A1
- [addition1] <-- Bookmark Name = A2
- [addition2] <-- Bookmark Name = A3
- [text2] <-- Bookmark Name = A4
- [text3] <-- Bookmark Name = A5
- {Ref A2} <-- Value when you press F9 is addition1
I would want {Ref A2} to remain text2 (its original assignment).
Any ideas?