Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 02-16-2012, 02:47 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,384
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,
Quote:
I need it to continue throughout the document to insert captions for all inline shapes without captions. One could run the code again but once it no longer finds any shapes without captions it just loops endlessly.

I tried modifying your code to insert captions for all uncaptioned shapes without success.
That's a fairly simple change, really. Replace:
Code:
      If InStr(TmpStr, .Text) = 0 Then
        iShp.Select
        Selection.GoTo What:=wdGoToObject
        Selection.MoveRight wdCharacter, 1
        Exit Sub
      End If
with:
Code:
      If InStr(TmpStr, .Text) = 0 Then
        iShp.Range.InsertCaption Label:="Figure", TitleAutoText:="", _
           Title:="", Position:=wdCaptionPositionBelow, ExcludeLabel:=0
      End If
All you need to do now is to add the code for looping through the other story ranges.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



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 08:09 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