Picture/Shading Macros in Word 2007

V

VBA dimwit

I just "upgraded" to Word 2007 and it appears that you can not use the
"record macro" feature to modify pictures or shapes like you could in Word
2002. I would like to create a macro to resize a selected picture after I
insert it into Word and also appliy a shadow effect border. I have managed to
coble togother a macro that does the resizing and applies a stock shadow
effect, which is below. I would like to change the chracteristics of the
shadow, specifically the Type, Blur, and Distance - just not sure what the
correct termanology/structure is. Any suggestions would be greatly
appreciated.

Sub Macro2()
'
' With ActiveWindow.Selection.InlineShape(1)
' set the size/position
Selection.InlineShapes(1).Width = InchesToPoints(3.6)
Selection.InlineShapes(1).Shadow.Type = msoShadow21
'
'
End Sub
 
J

Jay Freedman

Try something like this:

Sub x()
Dim shp As InlineShape
Dim shad As ShadowFormat

If Selection.InlineShapes.Count > 0 Then
Set shp = Selection.InlineShapes(1)
shp.Width = InchesToPoints(3.6)
Set shad = shp.Shadow
With shad
.Type = msoShadow21
.Blur = 12
.OffsetX = 2
.OffsetY = 3
End With
End If
End Sub

Although the help topic for the .Blur property doesn't describe it, it
appears to be the width in pixels of the "brush" used to blur the shadow.
The larger the number, the larger and softer the shadow.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
V

VBA dimwit

Jay, thanks for the help. I didn't need the off-setting, so I removed that
part of the code and it worked great.

Thank You.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top