Global objPPT As PowerPoint.Application
Global objPRES As PowerPoint.Presentation
Sub GetPPT()
On Error GoTo CreatePPT
Set objPPT = GetObject(, "PowerPoint.Application")
Exit Sub
CreatePPT:
Set objPPT = CreateObject("PowerPoint.Application")
Exit Sub
End Sub
Sub Test2342342()
GetPPT
Dim aPres As PowerPoint.Presentation
objPPT.Presentations.Add
Dim aP As PowerPoint.Presentation
Set aP = objPPT.Presentations(1)
aP.Slides.Add 1, ppLayoutBlank
Dim sld1 As Slide
Set sld1 = aP.Slides(1)
With aP.SlideShowSettings
.ShowType = ppShowTypeSpeaker
.LoopUntilStopped = msoFalse
.ShowWithNarration = msoTrue
.ShowWithAnimation = msoTrue
.RangeType = ppShowAll
.AdvanceMode = ppSlideShowUseSlideTimings
.PointerColor.RGB = RGB(Red:=255, Green:=0, Blue:=0)
.Run
End With
Dim SSW As SlideShowWindow
Set SSW = aP.SlideShowWindow
Dim slds As Slides
Set slds = aP.Slides
Dim mS As Slide
Set mS = slds(1)
mS.Shapes.AddShape msoShape8pointStar, 200, 200, 30, 30
Dim sh As Shape
Dim shs As Shapes
Set shs = mS.Shapes ' <<<< Error Here = "TYPE MISMATCH"
Set sh = shs(1)
With mS.Shapes(1)
For n = 1 To 100
sh.Left = sh.Left + Cos(n / pi) * 100
sh.Top = sh.Top + Cos(n / pi) * 100
DoTimer (0.033)
Next n
End With
End Sub
|