VBA/Excel/Access/Word/PowerPoint/PowerPoint

Материал из VB Эксперт
Перейти к: навигация, поиск

Adding a Slide to a Presentation

 
Sub add()
    Dim mySlide As Slide
    Set mySlide = ActivePresentation.Slides.Add(Index:=1, _
        Layout:=ppLayoutTitle)
End Sub



Closing a Presentation

 
Sub close()
    ActivePresentation.Close
End Sub



To avoid the user being prompted, set the Saved property of the Presentation object to True before using the Close method-for example:

 
Sub save()
    With Presentations("Your PPT.ppt")
        .Saved = True
        .Close
    End With
End Sub