VBA question ActiveWindow

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

Hello all,
I am trying to get this working from within Access VBA:

Public Function PowerpointWEBoutput()
Dim ppApp As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
Dim ppSlide1 As PowerPoint.Slide
Set ppApp = CreateObject("Powerpoint.Application")
Set ppPres = ppApp.Presentations.Add(msoTrue)
Set ppSlide1 = ppPres.Slides.Add(1, ppLayoutText)

ActiveWindow.Selection.SlideRange.Shapes.AddTextEffect(msoTextEffect29,
"MY TEXT", "Arial Black", 36#, msoFalse, msoFalse, 210.38, 244.75).Select
With ActiveWindow.Selection.ShapeRange
.IncrementLeft -9.12
.IncrementTop -161.88
End With
End Function

It does not work and comes all the times with an error message about the
ActiveWindow not working....can somebody tell how to solve this?

Rob
 
Rob,
ActiveWindow object will only be effective if the PowerPoint window is
visible. Either make the PowerPoint window visible or reference the slide
and shape as follows:

Set ppSlide1 = ppPres.Slides.Add(1, ppLayoutText)

Set ppoShp1= ppSlide1.Shapes.AddTextEffect(msoTextEffect29, _
"MY TEXT", "Arial Black", 36#, msoFalse, msoFalse, 210.38, 244.75)

With ppoShp1
.IncrementLeft -9.12
.IncrementTop -161.88
End With

--
Regards,
Shyam Pillai

Handout Wizard
http://skp.mvps.org/how
 
Back
Top