Hi,
I'm trying to create a macro delete to delete bookmarks from word. I'm pretty new to this but I found a macro (below) that deletes all bookmarks from a page and 1 that deletes an individual bookmark. What I'm looking to do is delete certain selected ones.
ex. bookmark1
bookmark2
bookmark3
bookmark4
I would want to highlight and delete bookmark 1 and 4.
Here's what I have so far. I'm sure this just needs to be tweeked abit.
Sub Delete_Bookmarks()
Dim Selected_Bookmark As Bookmark
ActiveDocument.Bookmarks.ShowHidden = True
If ActiveDocument.Bookmarks.Count >= 1 Then
For Each Selected_Bookmark In ActiveDocument.Bookmarks
Selected_Bookmark.Delete
Next Selected_Bookmark
End If
End Sub
Here is also another that deletes a single selected bookmark.
Sub DelBookmarks_individually()
For n = 1 To Selection.Bookmarks.Count
Selection.Bookmarks.Delete
Next n
End Sub
Any help would be appreciated. I tried to search but didn't find what I was looking for.
I'm trying to create a macro delete to delete bookmarks from word. I'm pretty new to this but I found a macro (below) that deletes all bookmarks from a page and 1 that deletes an individual bookmark. What I'm looking to do is delete certain selected ones.
ex. bookmark1
bookmark2
bookmark3
bookmark4
I would want to highlight and delete bookmark 1 and 4.
Here's what I have so far. I'm sure this just needs to be tweeked abit.
Sub Delete_Bookmarks()
Dim Selected_Bookmark As Bookmark
ActiveDocument.Bookmarks.ShowHidden = True
If ActiveDocument.Bookmarks.Count >= 1 Then
For Each Selected_Bookmark In ActiveDocument.Bookmarks
Selected_Bookmark.Delete
Next Selected_Bookmark
End If
End Sub
Here is also another that deletes a single selected bookmark.
Sub DelBookmarks_individually()
For n = 1 To Selection.Bookmarks.Count
Selection.Bookmarks.Delete
Next n
End Sub
Any help would be appreciated. I tried to search but didn't find what I was looking for.