View Single Post
 
Old 06-24-2016, 09:07 AM
Ajay2506 Ajay2506 is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Jun 2016
Posts: 8
Ajay2506 is on a distinguished road
Default Finding the graphics and inserting the keyword

Hi,

I am looking for some help in writing the vba macro to find all the figures in the word document and insert a line just above the each graphics in the work document.



Sub Macro1()
'
' Macro1 Macro
'
'
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 Replace:=wdReplaceAll
End Sub

Like in this code it is able to find all the graphics but we dont want to replace the graphics, we want to keep them and add the line.

Thanks in advance.
Reply With Quote