#1
|
|||
|
|||
Checking Captions
How can I find out that which photo in a document has not identified Caption automatically not searching manually? My document has so many Captioned photos and I just want to check if there is a photo WITHOUT Caption or not.
|
#2
|
||||
|
||||
There is no simple way of doing this, since the captions could appear in the same paragraph or in a separate paragraphs above or below the picture (the caption might even be in a textbox), and where the picture may or may not be formatted inline.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
macropod
All images are inline with text. All captions are defined with 'Insert Caption' and all of them are below images. I mean all images have same formatting and all captions have same formatting too. |
#4
|
||||
|
||||
But are they all in the same paragraph, a separate paragraph, or a mix of the two?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
No, photos and their captions are not in the same paragraph.
|
#6
|
||||
|
||||
OK, since they're not in the same paragraph, what else is between them?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Nothing is between them. Have a look at photo:
|
#8
|
||||
|
||||
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] |
#9
|
|||
|
|||
Ill try it. thanks.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VBA to insert captions without appending to existing captions | Marrick13 | Word VBA | 17 | 03-21-2023 07:51 PM |
Spell checking | kirkm | Word VBA | 3 | 09-16-2016 11:35 PM |
Some captions getting screwed up when fixing other captions | oliboi | Word | 2 | 08-30-2016 02:55 PM |
Captions: Changing captions in Appendix update all captions | carnestw | Word | 3 | 10-27-2015 12:34 PM |
Help with checking available times | Deepy | Excel | 1 | 02-14-2011 05:06 PM |