N
Nina
Hello,
I am very new to VBA. I am trying to create a macro for a Word 2007
document that finds a graphic, then resizes it to original size (Reset in
Format Picture dialog box). I have recorded the following, which produces
the result I want for one graphic. How do I make it loop so that it will
perform the action on ALL the graphics in my document? When responding,
please keep in mind that I am a novice with VBA.
Sub ResizeSlide()
'
' ResizeSlide Macro
'
'
Selection.Find.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
WordBasic.FormatPicture SetSize:=0, CropLeft:="0", CropRight:="0",
CropTop _
:="0", CropBottom:="0", ScaleX:=100, ScaleY:=100, SizeX:="5",
SizeY:= _
"3.75"
End Sub
I am very new to VBA. I am trying to create a macro for a Word 2007
document that finds a graphic, then resizes it to original size (Reset in
Format Picture dialog box). I have recorded the following, which produces
the result I want for one graphic. How do I make it loop so that it will
perform the action on ALL the graphics in my document? When responding,
please keep in mind that I am a novice with VBA.
Sub ResizeSlide()
'
' ResizeSlide Macro
'
'
Selection.Find.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
WordBasic.FormatPicture SetSize:=0, CropLeft:="0", CropRight:="0",
CropTop _
:="0", CropBottom:="0", ScaleX:=100, ScaleY:=100, SizeX:="5",
SizeY:= _
"3.75"
End Sub