A family of Microsoft presentation graphics products that offer tools for creating presentations and adding graphic effects like multimedia objects and special effects with text.
Hi,
Try below formatted and optimized code, please:
Sub Add_Slide_and_Format_Placeholder()
'Sample macro that adds a slide, formats its placeholder, and adds text _ to it. Recorded 12/4/08 by Rodney Converse.
With ActiveWindow
.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=2, _
Layout:=ppLayoutText).SlideIndex
.Selection.SlideRange.Layout = ppLayoutTitle
.Selection.SlideRange.Shapes(1).Select
End With
With ActiveWindow.Selection
.ShapeRange.IncrementLeft -6#
.ShapeRange.IncrementTop -125.75
.ShapeRange.ScaleHeight 1.56, msoFalse, msoScaleFromTopLeft
.SlideRange.Shapes(1).Select
.ShapeRange.TextFrame.TextRange.Select
.ShapeRange.TextFrame.TextRange.Characters(Start:=1, Length:=0).Select
End With
With ActiveWindow.Selection.TextRange
.Text = "The quick brown dog jumped over a lazy fox"
With .Font
.Name = "Arial"
.Size = 44
.Bold = msoFalse
.Italic = msoFalse
.Underline = msoFalse
.Shadow = msoFalse
.Emboss = msoFalse
.BaselineOffset = 0
.AutoRotateNumbers = msoFalse
.Color.SchemeColor = ppTitle
End With
End With
With ActiveWindow.Selection
.ShapeRange.TextFrame.TextRange.Characters(Start:=1, Length:=42).Select
With .TextRange.Font
.Name = "Impact"
.Size = 54
.Bold = msoFalse
.Italic = msoFalse
.Underline = msoFalse
.Shadow = msoFalse
.Emboss = msoFalse
.BaselineOffset = 0
.AutoRotateNumbers = msoFalse
.Color.SchemeColor = ppTitle
End With
End With
End Sub
PS:
When I test your code in PowerPoint 2007 and 2010, it all works OK! So I think the error is caused by your code format.
Cheers,
Cristin