Table and Figues Captions has no direct relation to the table and figures they caption. They are simply paragraphs in a specific ("Caption") style.
Code:
Selection = ActiveDocument.TablesOfFigures(2)
That is an interesting line of code. Could you elaborate?
Are looking to delete the actual paragraph lines "Table 1", "Figure 2" etc.? Or are you trying to delete a Table of Figures?
If you are trying to do the former, then:
Code:
Sub RemoveCaptions()
Dim oPara As Paragraph
For Each oPara In ActiveDocument.Paragraphs
If oPara.Style = "Caption" Then
oPara.Range.Delete
End If
Next
End Sub
does that.
BTW: as you seem to be posting this as a code question, please post to the VBA forum.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.