I have a long macro that jumps to different bookmarks and deletes columns from the selected tables. Here is an example from my macro:
If ActiveDocument.Bookmarks.Exists("ProposedOverallObj") = True Then
ActiveDocument.Bookmarks.Item("ProposedOverallObj").Select
Call ApproveProposedOverallObj
End If
and then the macro that that calls is:
Sub ApproveProposedOverallObj()
Selection.Cut
Selection.GoTo What:=wdGoToBookmark, Name:="Objectives"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.PasteAndFormat (wdPasteDefault)
Selection.Tables(1).Columns(5).Delete
Selection.Tables(1).Columns(4).Delete
Selection.Tables(1).Columns(3).Delete
Selection.Tables(1).Columns(2).SetWidth ColumnWidth:=600.5, RulerStyle:= _
wdAdjustFirstColumn
End If
End Sub
Sometimes these run ok, and sometimes they bug out and I get an error:
"Run-time error '5825': Object has been deleted.
Basically it deletes columns 5 and 3 and then bugs and says "I can't delete column 3 because it has been deleted" but...it hasn't. Column 3 is still very much there.