Thread: [Solved] Checking Captions
View Single Post
 
Old 11-09-2017, 10:52 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,359
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try the following macro. It will exit at the first uncaptioned inlineshape. Fix that, then re-run to find the next uncaptioned inlineshape, and so on.
Code:
Sub FindUncaptionedInlineShape()
Dim iShp As InlineShape, Rng As Range, Fld As Field, bCapt As Boolean
With ActiveDocument
  For Each iShp In .InlineShapes
    Set Rng = iShp.Range.Paragraphs.Last.Next.Range.Paragraphs.Last.Range
    With Rng
      If .Fields.Count = 0 Then
        iShp.Range.Paragraphs.Last.Range.Select
        Exit Sub
      Else
        bCapt = False
        For Each Fld In .Fields
          If Fld.Type = wdFieldSequence Then
            If Split(Trim(Fld.Code.Text), " ")(1) = "Figure" Then
              bCapt = True: Exit For
            End If
          End If
        Next
        If bCapt = False Then
          iShp.Range.Paragraphs.Last.Range.Select
          Exit Sub
        End If
      End If
    End With
  Next
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote