Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

Reply
 
LinkBack Thread Tools Display Modes
  #1  
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: 73
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
  #2  
Old 02-14-2014, 05:34 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,468
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

If you don't see a property in the GUI, it's unlikely to exist, including via VBA.

PS: When posting code, please use the code tags. They're on the 'Go Advanced' tab.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 02-14-2014, 06:02 PM
cheech1981 cheech1981 is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Nov 2011
Location: New Jersey, USA
Posts: 73
cheech1981 is on a distinguished road
Default

Ah okay thanks Paul...figured the same but was worth checking! (sorry about the code...will use tags next time).
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifying the distance between columns in the index Lebber Word 3 07-29-2013 12:27 AM
How to change save location and file to print name change? albertc Excel Programming 1 05-13-2012 07:05 PM
change the view to final, my change bars disappear. I need them visible anna.a.julin Word 1 03-01-2012 08:05 PM
How to control the distance above tables as we do for images? Jamal NUMAN Word 2 07-08-2011 04:09 AM
Why do we have this distance above the footer? Jamal NUMAN Word 4 04-14-2011 04:55 PM


All times are GMT -7. The time now is 12:25 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft