Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-15-2012, 10:52 PM
macropod's Avatar
macropod macropod is offline VBA to insert captions without appending to existing captions Windows 7 64bit VBA to insert captions without appending to existing captions Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Hi Marrick,

Word captions are inserted using the Caption Style. So, in general terms, you should look to see if the first non-empty paragraph before/after the inlineshape (depending on wheter the captions should be above/below) is in that Style. If so, you can probably safely not insert a caption for that inlineshape.

Edit: Here's some code I posted in another forum. It finds the first Inlineshape without a Caption, then exits after scrolling to the Shape concerned.


Code:
Sub FindUncaptionedShape()
Dim oCap As CaptionLabel, iShp As InlineShape, TmpRng As Range, TmpStr As String
For Each oCap In CaptionLabels
  TmpStr = TmpStr & CaptionLabels(oCap) & " "
Next
With ActiveDocument
  For Each iShp In .InlineShapes
    Set TmpRng = iShp.Range.Words.Last
    With TmpRng
      Do While Len(.Text) = 1
        .MoveEnd wdWord, 1
        .MoveStart wdWord, 1
      Loop
      If InStr(TmpStr, .Text) = 0 Then
        iShp.Select
        Selection.GoTo What:=wdGoToObject
        Selection.MoveRight wdCharacter, 1
        Exit Sub
      End If
    End With
  Next
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to insert captions without appending to existing captions Move existing table captions bcarlier Word Tables 17 05-10-2014 02:36 PM
Captions/Styles NWoffice Word 5 10-06-2011 10:26 AM
VBA to insert captions without appending to existing captions creating tables for row of figures and captions gib65 Word 2 08-12-2011 01:25 PM
VBA to insert captions without appending to existing captions Captions (tables and figures) mcjohn Word 1 02-11-2010 10:36 PM
Captions dwilliams Word 0 10-07-2009 08:30 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:59 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft