View Single Post
 
Old 02-14-2014, 08:04 AM
cheech1981 cheech1981 is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Nov 2011
Location: New Jersey, USA
Posts: 77
cheech1981 is on a distinguished road
Default change shadow distance

Hi all,

I am working in Word 2013 and I have a "with" statement in a macro to set shadow properties for an in-line shape.

I am able to set the shadow's type, blur, transparency, and size without a problem, but I am not sure how to set the shadow's distance property. I tried ".Distance = 1" but that caused an error. I don't see anything like distance available from the drop-down menu either, so I'm wondering if distance just isn't a valid VBA property for shadows?

Below is the full macro, which is a combination of a couple of ideas I saw on different forums and some tweaks (not my own). Thank you in advance for any ideas you have!

Sub AppendixShadowBorder()
'
' AppendixShadowBorder Macro
'
'
Dim shp As InlineShape
Dim shad As ShadowFormat

If Selection.InlineShapes.Count > 0 Then
Set shp = Selection.InlineShapes(1)
Set shad = shp.Shadow
With shad
.Type = msoShadow21
.Blur = 3
.Transparency = 0.6
.Size = 100
End With
Selection.InlineShapes(1).Borders.OutsideLineStyle = wdLineStyleSingle
Selection.InlineShapes(1).Borders.OutsideLineWidth = wdLineWidth050pt
Selection.InlineShapes(1).Borders.OutsideColor = RGB(243, 243, 243)

End If
End Sub
Reply With Quote