Adding manual shadow textbox to shape

S

Silvester

In Shyam Pillai's code below, a textbox appears locked to the bottom of the
slide. Since PP's font shadows are not very effective -

What if I want to add a manual shadow - another identical textbox slightly
offset behind the first aligned textbox, maybe 5 points, in a dark colour.

With the current code a shape is obviously locked into position. How can I
tweak positions a bit to enable manual shadows ?

'========================
Dim oSlide As Slide
Dim oShp As Shape
Set oSlide = ActiveWindow.Selection.SlideRange(1)
Set oShp = oSlide.Shapes.AddShape(msoTextOrientationHorizontal, 0#, 0#,
700#, 36#)

With oShp.TextFrame.TextRange
.Text = "1 This should appear at the bottom of the slide" & vbCrLf &
_
"2 This should appear at the bottom of the slide"

.ParagraphFormat.Bullet.Type = ppBulletNone
With .Font
.Name = "Arial": .Size = 28: .Bold = msoTrue:
.Italic = msoFalse: .Underline = msoFalse: .Shadow = msoTrue
End With

End With
With oShp
If .Width < .TextFrame.TextRange.BoundWidth Then
.Width = .TextFrame.TextRange.BoundWidth
End If
If .Height < .TextFrame.TextRange.BoundHeight Then
.Height = .TextFrame.TextRange.BoundHeight
End If
End With
With oSlide.Shapes.Range(oShp.ZOrderPosition)
.Align msoAlignBottoms, True
.Align msoAlignRights, True
End With
'-------------------------------------------------
 
S

Steve Rindsberg

In Shyam Pillai's code below, a textbox appears locked to the bottom of the
slide.

No, it's not locked in any way. You can manually drag it or change its .Top
and .Left properties to move it wherever you like.

You could do something like this to create a duplicate after creating the first
shape:

Dim oShpTwo as Shape
' Make a copy of the first shape
' The copy will become the real shape, the original shape will
' become the shadow
Set oShpTwo = oShp.Duplicate(1)

' Align the duplicate with the first shape
oShpTwo.Left = oShp.Left
oShpTwo.Top = oShp.Top

' Move the first shape two points to the right and down
' Change the offset to suit your needs
oShp.Left = oShp.Left + 2
oShp.Top = oShp.Top + 2

' Set the text color to gray (R200, G200, B200)
oShp.TextFrame.TextRange.Font.Color.RGB = RGB(200,200,200)

' Done

Since PP's font shadows are not very effective -
What if I want to add a manual shadow - another identical textbox slightly
offset behind the first aligned textbox, maybe 5 points, in a dark colour.

With the current code a shape is obviously locked into position. How can I
tweak positions a bit to enable manual shadows ?

'========================
Dim oSlide As Slide
Dim oShp As Shape
Set oSlide = ActiveWindow.Selection.SlideRange(1)
Set oShp = oSlide.Shapes.AddShape(msoTextOrientationHorizontal, 0#, 0#,
700#, 36#)

With oShp.TextFrame.TextRange
.Text = "1 This should appear at the bottom of the slide" & vbCrLf &
_
"2 This should appear at the bottom of the slide"

.ParagraphFormat.Bullet.Type = ppBulletNone
With .Font
.Name = "Arial": .Size = 28: .Bold = msoTrue:
.Italic = msoFalse: .Underline = msoFalse: .Shadow = msoTrue
End With

End With
With oShp
If .Width < .TextFrame.TextRange.BoundWidth Then
.Width = .TextFrame.TextRange.BoundWidth
End If
If .Height < .TextFrame.TextRange.BoundHeight Then
.Height = .TextFrame.TextRange.BoundHeight
End If
End With
With oSlide.Shapes.Range(oShp.ZOrderPosition)
.Align msoAlignBottoms, True
.Align msoAlignRights, True
End With
'-------------------------------------------------

--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
S

Silvester

Thanks very much Steve.

I needed to add
oShp.Fill.Visible = msoFalse
oShpTwo.Fill.Visible = msoFalse
and then everything worked fine
 
S

Steve Rindsberg

Thanks very much Steve.

I needed to add
oShp.Fill.Visible = msoFalse
oShpTwo.Fill.Visible = msoFalse
and then everything worked fine

Great ... I should have mentioned that you'd want to do the rest of the
formatting as needed.

--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 

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