VBA question ActiveWindow

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
 
D

Dirk Goldgar

Rob said:
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?


I don't know anything about PowerPoint, but I'd expect that you need to
qualify ActiveWindow with a reference to the PowerPoint application object:

ppApp.ActiveWindow.Selection.SlideRange.Shapes.AddTextEffect( ...

With ppApp.ActiveWindow.Selection.ShapeRange

etc.
 

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