Sub SelectTextBetweenBookmarks() Dim doc As Document Dim Rng As Range Dim bm1 As Bookmark, bm2 As Bookmark Set doc = ActiveDocument Set bm1 = doc.Bookmarks("StartCopy") Set bm2 = doc.Bookmarks("EndCopy") Set Rng = doc.Range(bm1.End, bm2.Start) Rng.Delete End Sub
I have realised Graham's code is not selecting Bookmarks, which is what I need. I am just test it.Do you mean the code I suggested selected any of bookmarks?
It will be a little more complicated to consider two bookmarks, but do you really need to use two? Select all the text that you want to bookmark and then insert the one bookmark. It will contain all the selected text.
Sub DeleteBookMarktext(bmk As Bookmark) Dim strName As String Dim rng As Range strName = bmk.Name Set rng = bmk.Range rng.Delete rng.Document.Bookmarks.Add strName, rng End Sub
I note that your code make the same assumption as mine did, but does it in a slightly different way