J
Jan Kronsell
I like to create a new PP presentation, add a new slide and then paste
something into that slide. But for some reason I can't get it to aded the
slide. It creates the presentation Ok, but never adds a slide and therefore
do not pastre anything: What am I doing wrong. This is my code so far:
Dim ppApp As Object
On Error Resume Next
Set ppApp = GetObject(, "powerpoint.application")
If Err.Number <> 0 Then
Set ppApp = CreateObject("powerpoint.Application")
End If
ppApp.Presentations.Add WithWindow:=msoTrue
ppApp.Activate
ppApp.ActiveWindow.View.GotoSlide
Index:=ActivePresentation.Slides.Add(Index:=1,
Layout:=ppLayoutTitle).SlideIndex
ppApp.ActiveWindow.Selection.SlideRange.Layout = ppLayoutTitleOnly
ppApp.ActiveWindow.View.Paste
ppApp.Visible = True
Set ppApp = Nothing
Regards
Jan
something into that slide. But for some reason I can't get it to aded the
slide. It creates the presentation Ok, but never adds a slide and therefore
do not pastre anything: What am I doing wrong. This is my code so far:
Dim ppApp As Object
On Error Resume Next
Set ppApp = GetObject(, "powerpoint.application")
If Err.Number <> 0 Then
Set ppApp = CreateObject("powerpoint.Application")
End If
ppApp.Presentations.Add WithWindow:=msoTrue
ppApp.Activate
ppApp.ActiveWindow.View.GotoSlide
Index:=ActivePresentation.Slides.Add(Index:=1,
Layout:=ppLayoutTitle).SlideIndex
ppApp.ActiveWindow.Selection.SlideRange.Layout = ppLayoutTitleOnly
ppApp.ActiveWindow.View.Paste
ppApp.Visible = True
Set ppApp = Nothing
Regards
Jan