G
Greg Maxey
Using Word2007 I can easily insert a picture (as an InLineShape) from a
file and then use Picture Tools>Format>Picture Effects>Shadow to add a
shadow and Size to resize the picture.
When I try to do that programatically with an InLineShape, the shadow
applied is like some sort of defualt shadow. The .forecolor, offsetX,
offsetY attributres are ignored.
Sub InsertImageAtSelection1()
Dim oILS As InlineShape
Dim y As Single
Set oILS = ActiveDocument.InlineShapes(1)
With oILS
y = CSng(.Height) / CSng(.Width)
.Width = InchesToPoints(2)
.Height = y * .Width
With .Shadow
.OffsetX = -5
.OffsetY = -3
.ForeColor.RGB = RGB(0, 0, 0)
.Transparency = 0.5
.Visible = msoCTrue
End With
End With
End Sub
If I first set the shadow.visible attribute on the InLineShape then covert
to a shape, I can apply the proper attributes. I then change back to an
InLineShape. Is this by design, a bug, or am I just off base on my methods?
Thanks,.
Sub InsertImageAtSelection2()
Dim oILS As InlineShape
Dim oShp As Shape
Dim y As Single
Set oILS = ActiveDocument.InlineShapes(1)
With oILS
y = CSng(.Height) / CSng(.Width)
.Width = InchesToPoints(2)
.Height = y * .Width
.Shadow.Visible = msoCTrue
End With
Set oShp = oILS.ConvertToShape
With oShp
With .Shadow
.OffsetX = -5
.OffsetY = -3
.ForeColor.RGB = RGB(0, 0, 0)
.Transparency = 0.5
.Visible = msoCTrue
End With
.ConvertToInlineShape
End With
End Sub
--
Greg Maxey - Word MVP
My web site http://gregmaxey.mvps.org
McCain/Palin '08 !!!
file and then use Picture Tools>Format>Picture Effects>Shadow to add a
shadow and Size to resize the picture.
When I try to do that programatically with an InLineShape, the shadow
applied is like some sort of defualt shadow. The .forecolor, offsetX,
offsetY attributres are ignored.
Sub InsertImageAtSelection1()
Dim oILS As InlineShape
Dim y As Single
Set oILS = ActiveDocument.InlineShapes(1)
With oILS
y = CSng(.Height) / CSng(.Width)
.Width = InchesToPoints(2)
.Height = y * .Width
With .Shadow
.OffsetX = -5
.OffsetY = -3
.ForeColor.RGB = RGB(0, 0, 0)
.Transparency = 0.5
.Visible = msoCTrue
End With
End With
End Sub
If I first set the shadow.visible attribute on the InLineShape then covert
to a shape, I can apply the proper attributes. I then change back to an
InLineShape. Is this by design, a bug, or am I just off base on my methods?
Thanks,.
Sub InsertImageAtSelection2()
Dim oILS As InlineShape
Dim oShp As Shape
Dim y As Single
Set oILS = ActiveDocument.InlineShapes(1)
With oILS
y = CSng(.Height) / CSng(.Width)
.Width = InchesToPoints(2)
.Height = y * .Width
.Shadow.Visible = msoCTrue
End With
Set oShp = oILS.ConvertToShape
With oShp
With .Shadow
.OffsetX = -5
.OffsetY = -3
.ForeColor.RGB = RGB(0, 0, 0)
.Transparency = 0.5
.Visible = msoCTrue
End With
.ConvertToInlineShape
End With
End Sub
--
Greg Maxey - Word MVP
My web site http://gregmaxey.mvps.org
McCain/Palin '08 !!!