Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-11-2014, 05:46 AM
Navis Navis is offline Macro to add captions to pictures inside word document Windows XP Macro to add captions to pictures inside word document Office 2010 64bit
Novice
Macro to add captions to pictures inside word document
 
Join Date: Feb 2014
Posts: 1
Navis is on a distinguished road
Post Macro to add captions to pictures inside word document

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
Reply With Quote
 

Tags
automatic figure caption



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to add captions to pictures inside word document VBA to insert captions without appending to existing captions Marrick13 Word VBA 17 03-21-2023 07:51 PM
Macro to add captions to pictures inside word document Help formatting Pictures inside a Text Box in Word 2013 jstumbo87 Word 2 01-29-2014 12:07 PM
Macro to add captions to pictures inside word document Macro to read word document 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

Other Forums: Access Forums

All times are GMT -7. The time now is 08:47 AM.


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