Sorry macropod, I simply do not understand.
What is with the InlineShapes??? WHAT InlineShape? There has been no mention whatsoever of InlineShapes. The OP wrote:
"I was wondering if there was a method of deleting table captions or figures in vba? "
Where is there anything about an InlineShape? True, when one uses "figures", then it is edging towards InlineShapes, as most inserted figures are InlineShapes. But tables are not.
Even if you do insert a graphic, say, and it gets a caption "Figure 1", there is still no direct relationship to the InlineShape. You can select the InlineShape and delete it...the caption remains. You can insert text
between the Caption and the InlineShape (or table for that matter). Say the caption is set for below the figure...
[InlineShape_A]
Figure 1
There is no problem putting other stuff between them.
[InlineShape_A]
Some text going into here, blah blah.
Figure 1
There is no problem putting another InlineShape(s) (or table) between a figure and its caption, or more than one.
[InlineShape_A]
Some text yadda yadda
[InlineShape_B]
Figure 2
Some more other text blah blah
[InlineShape_C]
Figure 3
Figure 1
In my mind there such a disconnection between Caption and its "owner" that I am very wary of them. For example, if you put ONE picture (Insert > Picture > From File...) into a document, and you have its set up for automatic caption you end up with (assuming caption is for "below"):
PICTURE
Figure 1
Let's suppose you have a bunch of paragraphs below the figure, for convenience, let's make them empty (<p>).
PICTURE
Figure 1
<p>
<p>
<p>
<p>
<p>
Now select PICTURE - an InlineShape. Drag it to the second <p>. What do you get?
Figure 1
<p>
PICTURE
Figure 2<p>
<p>
<p>
<p>
Now drag it again, to the third <p>.
Figure 1
<p>
Figure 2<p>
PICTURE
Figure 3<p>
<p>
<p>
And so on. It is quite possible - I just did it - to end up with:
Figure 1
<p>
Figure 2<p>
Figure 3<p>
<p>
Figure 4<p>
PICTURE
Figure 5<p>
FIVE Captions for ONE InlineShape. That is because the caption is actually text plus a SEQ field. Captions do not have any direct relationship to the object that generated them. Once a caption is generated, it is stand-alone.
But (I admit I am having a stupid day), I still do not understand the logic of your code re: InlineShape and
It may - or may not - have anything to do with the last word.
Gerry