![]() |
#1
|
|||
|
|||
![]()
Hi,
I am very new to VB and Macros. I have around 100 images in my document and i need to assign format style "Captions" to all my images and insert Figure Captions below images as "Figure 1: <<Insert Titele Here>>". I recorded macro and my macro look like below and unable to loop this for entire document. Sub Macro1() ' ' Macro1 Macro ' ' Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:="1" Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^g" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Selection.Style = ActiveDocument.Styles("Caption") Selection.InsertCaption Label:="Figure", TitleAutoText:="InsertCaption1", _ Title:="", Position:=wdCaptionPositionBelow, ExcludeLabel:=0 End Sub |
Tags |
automatic figure caption |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Marrick13 | Word VBA | 17 | 03-21-2023 07:51 PM |
![]() |
jstumbo87 | Word | 2 | 01-29-2014 12:07 PM |
![]() |
harishankar.selvaraju | Excel Programming | 1 | 06-14-2012 03:48 AM |
Where we can find a Word document (docx file) that contains professional work inside? | Jamal NUMAN | Word | 0 | 06-26-2011 09:57 AM |
Captions and Figures Inside a Frame...RIDICULOUS MS hasn't developed a solution!!! | stlsmiln | Word | 2 | 02-23-2010 02:15 AM |