View Single Post
 
Old 04-26-2015, 04:39 PM
Guessed's Avatar
Guessed Guessed is offline Windows 7 32bit Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,992
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You haven't made it clear what constitutes empty but if we assume that the bookmark length = 0 means empty then you might do it this way
Code:
Sub Cleanup()
  Dim x As Integer, sBkmk As String
  For x = 60 To 1 Step -1
    sBkmk = "Prob" & x
    If ActiveDocument.Bookmarks.Exists(sBkmk) Then
      If Len(ActiveDocument.Bookmarks(sBkmk).Range.Text) = 0 Then
        ActiveDocument.Bookmarks(sBkmk).Range.Rows(1).Delete
      End If
    End If
  Next x
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote